Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Assert_mixed_block_layout_v1 macro #2647

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ocaml/runtime/caml/mlvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,22 @@ CAMLextern value caml_atom(tag_t);

CAMLextern value caml_set_oo_id(value obj);

/* Users write this to assert that the ensuing C code is sensitive
to the current layout of mixed blocks in a way that's subject
to change in future compiler releases. We'll bump the version
number when we make a breaking change. For example, we currently
don't pack int32's efficiently, and we will want to someday.

Users can write:

Assert_mixed_block_layout_v1;

(Hack: we define using _Static_assert rather than just an empty
definition so that users can write a semicolon, which is treated
better by C formatters.)
*/
#define Assert_mixed_block_layout_v1 _Static_assert(1, "")

/* Header for out-of-heap blocks. */

#define Caml_out_of_heap_header_with_reserved(wosize, tag, reserved) \
Expand Down
Loading