20,741
edits
m (→naNew()) |
m (→naNew()) |
||
| Line 76: | Line 76: | ||
The final argument to the naGC_get() function is a pointer to to the context's nfree[type] member which is updated by the function. | The final argument to the naGC_get() function is a pointer to to the context's nfree[type] member which is updated by the function. | ||
Next, a new naRef structure is set up using the allocated naObj memory and the type info: | |||
<syntaxhighlight lang="C"> | |||
result = naObj(type, c->free[type][--c->nfree[type]]); | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="C"> | |||
naRef naObj(int type, struct naObj* o) | |||
{ | |||
naRef r; | |||
SETPTR(r, o); | |||
o->type = type; | |||
return r; | |||
} | |||
</syntaxhighlight> | |||
= Pool storage = | = Pool storage = | ||