ObjClass* wrenNewSingleClass(WrenVM* vm, int numFields, ObjString* name) { ObjClass* classObj = ALLOCATE(vm, ObjClass); initObj(vm, &classObj->obj, OBJ_CLASS, NULL); classObj->superclass = NULL; classObj->numFields = numFields; classObj->name = name; wrenPushRoot(vm, (Obj*)classObj); wrenMethodBufferInit(&classObj->methods); wrenPopRoot(vm); return classObj; }
ObjClass* wrenNewSingleClass(WrenVM* vm, int numFields, ObjString* name) { ObjClass* classObj = allocate(vm, sizeof(ObjClass)); initObj(vm, &classObj->obj, OBJ_CLASS, NULL); classObj->superclass = NULL; classObj->numFields = numFields; classObj->name = name; WREN_PIN(vm, classObj); wrenMethodBufferInit(vm, &classObj->methods); WREN_UNPIN(vm); return classObj; }