20,741
edits
| Line 146: | Line 146: | ||
p->nfree = p->freesz = p->freetop = 0; | p->nfree = p->freesz = p->freetop = 0; | ||
reap(p); | reap(p); | ||
} | |||
</syntaxhighlight> | |||
The size of a memory pool is determined using poolsize(): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line186 | |||
<syntaxhighlight lang="C"> | |||
static int poolsize(struct naPool* p) | |||
{ | |||
int total = 0; | |||
struct Block* b = p->blocks; | |||
while(b) { total += b->size; b = b->next; } | |||
return total; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||