|
|
|
@ -4,7 +4,8 @@
|
|
|
|
|
|
|
|
|
|
struct SQUserData : SQDelegable
|
|
|
|
|
{
|
|
|
|
|
SQUserData(SQSharedState *ss){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); }
|
|
|
|
|
SQUserData(SQSharedState *ss, SQInteger size){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); _size = size; _typetag = 0;
|
|
|
|
|
}
|
|
|
|
|
~SQUserData()
|
|
|
|
|
{
|
|
|
|
|
REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain, this);
|
|
|
|
@ -13,9 +14,7 @@ struct SQUserData : SQDelegable
|
|
|
|
|
static SQUserData* Create(SQSharedState *ss, SQInteger size)
|
|
|
|
|
{
|
|
|
|
|
SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1));
|
|
|
|
|
new (ud) SQUserData(ss);
|
|
|
|
|
ud->_size = size;
|
|
|
|
|
ud->_typetag = 0;
|
|
|
|
|
new (ud) SQUserData(ss, size);
|
|
|
|
|
return ud;
|
|
|
|
|
}
|
|
|
|
|
#ifndef NO_GARBAGE_COLLECTOR
|
|
|
|
|