Christian Walther d6d02c67d2 Fix inconsistent supervisor heap.
When allocations were freed in a different order from the reverse of how they were allocated (leaving holes), the heap would get into an inconsistent state, eventually resulting in crashes.

free_memory() relies on having allocations in order, but allocate_memory() did not guarantee that: It reused the first allocation with a NULL ptr without ensuring that it was between low_address and high_address. When it belongs to a hole in the allocated memory, such an allocation is not really free for reuse, because free_memory() still needs its length.

Instead, explicitly mark allocations available for reuse with a special (invalid) value in the length field. Only allocations that lie between low_address and high_address are marked that way.
2020-10-02 23:03:21 +02:00
..
2018-08-07 14:58:57 -07:00
2020-10-02 23:03:21 +02:00
2020-09-28 18:55:56 -05:00
2020-07-06 19:16:25 +01:00
2020-09-28 18:55:56 -05:00
2020-01-28 17:11:25 -05:00