diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2020-06-13 18:23:08 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2020-06-13 18:23:08 +0200 |
commit | d6f949608db2566bb928df7aeae5c1e2ca1dad29 (patch) | |
tree | d9ebefe742c191010deda2d3fb7a4f174d386b8e /runtime | |
parent | b0cd12d1c48fb22d7d06d49c7976bccce7d58068 (diff) | |
download | ocaml-d6f949608db2566bb928df7aeae5c1e2ca1dad29.tar.gz |
Remove the primitive functions caml_static_{alloc,free,resize}
These primitives are dangerous because they produce naked pointers
outside the OCaml heap, with a risk of "GC pointer confusion".
(After caml_free and a heap extension, the freed memory area can be
reallocated as part of the OCaml heap, causing the naked pointer to
become a bad heap pointer).
These primitives are not used anywhere in the core OCaml system
(in particular they are not exposed via the Obj module).
An OPAM-wide grep shows no uses there either.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/obj.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/runtime/obj.c b/runtime/obj.c index efbffd36a6..6cc0c5e660 100644 --- a/runtime/obj.c +++ b/runtime/obj.c @@ -31,23 +31,6 @@ #include "caml/signals.h" #include "caml/spacetime.h" -/* [size] is a value encoding a number of bytes */ -CAMLprim value caml_static_alloc(value size) -{ - return (value) caml_stat_alloc((asize_t) Long_val(size)); -} - -CAMLprim value caml_static_free(value blk) -{ - caml_stat_free((void *) blk); - return Val_unit; -} - -CAMLprim value caml_static_resize(value blk, value new_size) -{ - return (value) caml_stat_resize((char *) blk, (asize_t) Long_val(new_size)); -} - /* unused since GPR#427 */ CAMLprim value caml_obj_is_block(value arg) { |