Skip to content

caml_make_float_vect in no-flat-float array: use static allocation#11552

Merged
xavierleroy merged 3 commits intoocaml:trunkfrom
xavierleroy:make_float_vect
Sep 23, 2022
Merged

caml_make_float_vect in no-flat-float array: use static allocation#11552
xavierleroy merged 3 commits intoocaml:trunkfrom
xavierleroy:make_float_vect

Conversation

@xavierleroy
Copy link
Copy Markdown
Contributor

Allocate the initializing float block statically and outside the heap, rather than dynamically at first use. Not only it's more efficient, but it also avoids the race condition reported in #11504.

Fixes: #11504

Allocate the initializing float statically and outside the heap,
rather than dynamically at first use.  Not only it's more efficient,
but it also avoids a race condition.

Fixes: ocaml#11504
@xavierleroy xavierleroy added this to the 5.0 milestone Sep 21, 2022
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also LGTM!

@xavierleroy xavierleroy merged commit c7048ce into ocaml:trunk Sep 23, 2022
@xavierleroy xavierleroy deleted the make_float_vect branch September 23, 2022 10:00
xavierleroy added a commit that referenced this pull request Sep 23, 2022
…11552)

Allocate the initializing float statically and outside the heap,
rather than dynamically at first use.  Not only it's more efficient,
but it also avoids a race condition.

Fixes: #11504
(cherry picked from commit c7048ce)
@xavierleroy
Copy link
Copy Markdown
Contributor Author

Cherry-picked to 5.0: 4164b49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread-unsafety in caml_make_float_vect

2 participants