defragster
Senior Member+
As noted p#11 the first caller to malloc() sets baseline ptr* brkval - that is the 'logic' behind the main thread alloc 'hack':
Indeed, testing a series of allocs ( and free's ) Main and Thread1 - perhaps another thread or two to see if the allocations are coming from the desired memory area and not over lapping.
Code:
if (__brkval == 0)
__brkval = __malloc_heap_start;
cp = __malloc_heap_end;
if (cp == 0)
cp = STACK_POINTER() - __malloc_margin;
Indeed, testing a series of allocs ( and free's ) Main and Thread1 - perhaps another thread or two to see if the allocations are coming from the desired memory area and not over lapping.