configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
I double checked and there is still availble heap to allocate from, hwoever for some reason everything hangs at mentioned assert. I’m using heap_4 alloc scheme. Are there any particular reasons why this might be happening?
This assert doesn’t check for an exhausted heap, it checks that your allocator satisfies the alignment requirement of the processor achitecture used.
You should check check portmacro.h::portBYTE_ALIGNMENT and the resulting portable.h::portBYTE_ALIGNMENT_MASK vs. your allocator implementation.
I’ve checked it and it’s correct, I would assume in this case that newBlock (this is inside condition that splits blocks) is not aligned properly this condition occurs after several calls to pvPortMalloc. First few calls are ok but later on it hangs. To be honest I have no idea what’s going on. I would avoid using dynamic allocation but I have no other options in this case… Any ideas where to go next?
I’ve checked it and it’s correct, I would assume in this case that newBlock (this is inside condition that splits blocks) is not aligned properly this condition occurs after several calls to pvPortMalloc. First few calls are ok but later on it hangs. To be honest I have no idea what’s going on. I would avoid using dynamic allocation but I have no other options in this case… Any ideas where to go next?
I examined memory and turns out there was memory leak after writing to previously allocated memory. Which was the result of misalignment. Anyway thanks for help:)