Skip to main content

ENGINE_BOX_TAG

Constant ENGINE_BOX_TAG 

Source
pub const ENGINE_BOX_TAG: i32 = TAG_OBJECT /* -1i32 */;
Expand description

The tag a reference-counted engine value is boxed under.

Every refcounted payload the C API can see is an Object here, including strings and symbols: the engine’s Value is a 16-byte enum, so the distinction lives inside the box rather than in the tag. That is invisible from C — JS_IsString is answered by asking the box, not by looking at the tag — and it keeps one allocation shape instead of five.

The exception is a string, which JS_IsString and JS_ToString both need to recognise, and which C-side code never dereferences beyond ref_count.