X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fobject.h;h=1435f5d353098a0105296df4b9fe01ac116a996d;hb=refs%2Fheads%2Fmaster;hp=56f17b6425d598aee2174f1edcdd40cb66f0f2c5;hpb=56694525a0ce70e971de1f145c714a30ecce6742;p=muddle-interpreter.git diff --git a/src/object.h b/src/object.h index 56f17b6..1435f5d 100644 --- a/src/object.h +++ b/src/object.h @@ -272,7 +272,11 @@ union object // NB. never take the address of these type-punned fields! alignas (16) evaltype type; opaque32 _unknown0; - opaque64 _unknown1; + union + { + opaque64 _unknown1; + uv_val uv_val; + }; }; /// objects of statically known type /// use as_X() for checked downcast @@ -324,7 +328,6 @@ new_list (pool_ptr head) ,}; } -// TODO: take a dope_object like uvector static inline vector_object new_vector (heap_ptr body, uint32_t length) { @@ -401,6 +404,10 @@ utype (const uvector_object * o) return uv_dope (o)->type; } +object +uv_get (const uvector_object * o, uint32_t i); + + // Change the EVALTYPE of an object. New type must have same PRIMTYPE. static inline void chtype (object * o, evaltype type)