{
size_t n;
size_t pn;
- Pool* pool;
+ Pool* pool;
for (n = 0; n < gc.pools.length; n++)
{
{
if (pool.finals.nbits && pool.finals.testClear(bit_i)) {
if (opts.options.sentinel)
- rt_finalize(cast(List *)sentinel_add(p), false/*gc.no_stack > 0*/);
+ rt_finalize(sentinel_add(p), false/*gc.no_stack > 0*/);
else
- rt_finalize(cast(List *)p, false/*gc.no_stack > 0*/);
+ rt_finalize(p, false/*gc.no_stack > 0*/);
}
clrAttr(pool, bit_i, BlkAttr.ALL_BITS);
- List *list = cast(List *)p;
-
if (opts.options.mem_stomp)
memset(p, 0xF3, size);
}
pool.freebits.set(bit_i);
if (pool.finals.nbits && pool.finals.testClear(bit_i)) {
if (opts.options.sentinel)
- rt_finalize(cast(List *)sentinel_add(p), false/*gc.no_stack > 0*/);
+ rt_finalize(sentinel_add(p), false/*gc.no_stack > 0*/);
else
- rt_finalize(cast(List *)p, false/*gc.no_stack > 0*/);
+ rt_finalize(p, false/*gc.no_stack > 0*/);
}
clrAttr(pool, bit_i, BlkAttr.ALL_BITS);
- List *list = cast(List *)p;
-
if (opts.options.mem_stomp)
memset(p, 0xF3, size);
if (!gc.free_list[bin] && !allocPage(bin))
{
newPool(1); // allocate new pool to find a new page
+ // TODO: hint allocPage() to use the pool we just created
int result = allocPage(bin);
if (!result)
onOutOfMemoryError();
else
{
// Add to free list
- List *list = cast(List*)p;
+ List* list = cast(List*) p;
if (opts.options.mem_stomp)
memset(p, 0xF2, binsize[bin]);
if (bin < B_PAGE)
{
// Check that p is not on a free list
- List *list;
-
- for (list = gc.free_list[bin]; list; list = list.next)
+ for (List* list = gc.free_list[bin]; list; list = list.next)
{
assert(cast(void*)list != p);
}
for (n = 0; n < B_PAGE; n++)
{
- for (List *list = gc.free_list[n]; list; list = list.next)
+ for (List* list = gc.free_list[n]; list; list = list.next)
flsize += binsize[n];
}
npages = 0;
poolsize = 0;
}
- //assert(baseAddr);
topAddr = baseAddr + poolsize;
size_t nbits = cast(size_t)poolsize / 16;