Reword what will happen with pointers outside the heap

Following review comments.

Also: fix the assertion in the third val_of_typtr function.
master
Xavier Leroy 2020-06-04 10:24:56 +02:00 committed by octachron
parent a22f6f5f03
commit bea823a1ea
1 changed files with 2 additions and 2 deletions

View File

@ -478,7 +478,7 @@ floating-point numbers.}
In earlier versions of OCaml, it was possible to use
word-aligned pointers to addresses outside the heap as OCaml values,
just by casting the pointer to type "value". Starting with OCaml
4.11, this usage is obsolete and will stop being supported soon.
4.11, this usage is deprecated and will stop being supported in OCaml 5.00.
A correct way to manipulate pointers to out-of-heap blocks from
OCaml is to store those pointers in OCaml blocks with tag
@ -526,7 +526,7 @@ integer.
/* Create an OCaml value encapsulating the pointer p */
static value val_of_typtr(ty * p)
{
assert ((uintptr_t) p & 1 == 0); /* check correct alignment */
assert (((uintptr_t) p & 1) == 0); /* check correct alignment */
return (value) p | 1;
}