When:
init_mempool(0x0000, 1024); p = malloc(10);
init_mempool(0x2000, 1024); p = malloc(10);
What else in your program might use memory starting at address 0? Have you reserved that range of memory to use as your heap? I'd expect the heap to start near the top of memory (under any reentrant stack), unless you have no other xdata usage whatsoever.
"What else in your program might use memory starting at address 0? Have you reserved that range of memory to use as your heap? I'd expect the heap to start near the top of memory (under any reentrant stack), unless you have no other xdata usage whatsoever. " Yes, this is the matter. An array should be declared to reserve the memory used by the heap. I'm thinking why init_mempool doesn't do that for me? Thanks a lot. d.curie