Skip to content
Success

Changes

Summary

  1. Initialise in caml_obj_block / Obj.new_block only when necessary  (#9513) (commit: 9355b4e) (details)
Commit 9355b4e8f57fe19087046e67ef22113440608ad4 by noreply
Initialise in caml_obj_block / Obj.new_block only when necessary  (#9513)

caml_alloc returns initialised blocks for tag < No_scan_tag. Otherwise,
initialise the blocks as necessary.

For Abtract_tag, Double_tag and Double_array_tag, the initial contents
are irrelevant.

Uninitialised Custom_tag objects are difficult to use correctly. Hence,
reject custom block allocations through Obj.new_block.

For String_tag, the last byte encodes the string length. Hence, reject
zero-length string objects. Initialise the last byte which encodes the
length to ensure non-negative lengths for uninitialised strings.
(commit: 9355b4e)
The file was addedtestsuite/tests/lib-obj/new_obj.ml
The file was modifiedChanges (diff)
The file was addedtestsuite/tests/lib-obj/new_obj.reference
The file was modifiedruntime/obj.c (diff)