1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

memtype-managed: calculate block lengths correctly

This commit is contained in:
Georg Reinke 2017-03-29 12:00:49 +02:00
parent 78f5a3f818
commit c749821b8d

View file

@ -132,7 +132,7 @@ void* memory_managed_alloc(struct memtype *m, size_t len, size_t alignment)
* The original block descriptor is already at the correct
* position, so we just change its len and create a new block
* descriptor for the actual block we're handling. */
block->len = gap;
block->len = gap - sizeof(struct memblock);
struct memblock *newblock = (struct memblock*) (cptr - sizeof(struct memblock));
newblock->prev = block;
newblock->next = block->next;