I need to attach the full (void) data into v7 objects, the problem is that v7 make my user_data as foreign, so special datas like (void)0 / (void*)1 are forbidden.
I hack v7 source and find a solution. I make the user_data property as _V7_PROPERTY_OFF_HEAP, and fixed some code to be friendly with it.
Source change list:
In get_or_create_user_data_property, make the made property as _V7_PROPERTY_OFF_HEAP:
Finally in gc_mark , I think there should be an BUG ??
/* mark object itself, and its properties */
for ((prop = obj_base->properties), MARK(obj_base); prop != NULL;
prop = next) {
if (prop->attributes & _V7_PROPERTY_OFF_HEAP) {
//break;
next = prop->next;
MARK(prop); // mark or gc_sweep will free it
continue;
}
...
}
I need to attach the full (void) data into v7 objects, the problem is that v7 make my user_data as foreign, so special datas like (void)0 / (void*)1 are forbidden.
I hack v7 source and find a solution. I make the user_data property as _V7_PROPERTY_OFF_HEAP, and fixed some code to be friendly with it.
Source change list:
In get_or_create_user_data_property, make the made property as _V7_PROPERTY_OFF_HEAP:
In v7_set_user_data, set user_data as raw:
In v7_get_user_data, return the raw user_data:
In v7_set_destructor_cb, set cb as raw:
In generic_object_destructor, use raw cb and user_data:
Finally in gc_mark , I think there should be an BUG ??