-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Definition of Is_young is incomplete #11464
Copy link
Copy link
Closed
Description
When attempting to use Is_young in C code, I get the following error:
/home/gm/.opam/5.0.0+trunk/lib/ocaml/caml/mlvalues.h:214:28: error: ‘caml_minor_heaps_end’ undeclared (first use in this function); did you mean ‘caml_minor_tables’?
214 | (char *)(val) < (char *)caml_minor_heaps_end && \
| ^~~~~~~~~~~~~~~~~~~~
In 5.0, Is_young is defined in mlvalues.h. In 4.14, it is defined in address_class.h (which includes mlvalues.h).
In 5.0, Is_young depends on global variables defined in domain.h (which neither mlvalues.h nor address_class.h includes) and protected with CAML_INTERNALS. This is inconsistent with its public definition in 5.0 (which does not work) and in 4.14 (which works).
There are likely several ways of fixing this. I do not have strong opinions but I prefer a solution that keeps Is_young public.
Reactions are currently unavailable