Make pinned list a linked list instead of hardcoded array.

This commit is contained in:
Bob Nystrom
2013-11-29 09:18:13 -08:00
parent 715fecdc7c
commit 1b353e9380
4 changed files with 44 additions and 24 deletions
+3 -2
View File
@@ -1542,7 +1542,8 @@ ObjFn* wrenCompile(WrenVM* vm, const char* source)
Compiler compiler;
initCompiler(&compiler, &parser, NULL, 0);
pinObj(vm, (Obj*)compiler.fn);
PinnedObj pinned;
pinObj(vm, (Obj*)compiler.fn, &pinned);
for (;;)
{
@@ -1563,7 +1564,7 @@ ObjFn* wrenCompile(WrenVM* vm, const char* source)
emit(&compiler, CODE_END);
unpinObj(vm, (Obj*)compiler.fn);
unpinObj(vm);
return parser.hasError ? NULL : compiler.fn;
}