Commit graph

7 commits

Author SHA1 Message Date
Andreas Kling
5f7bb9d072 malloc: Make it possible to recycle big allocation blocks as well.
This patch makes us recycle up to 8 blocks of 4KB size. This should
probably be extended to handle other sizes.
2019-05-14 16:38:06 +02:00
Andreas Kling
66e401d668 LibC: Tune the number of ChunkedBlocks we keep around empty.
At the moment, both mmap() and munmap() are kind of slow. Compiling with GCC
was suffering quite badly from munmap() slowness, so let's keep a few more
of the ChunkedBlocks around after they are empty, to avoid having to munmap.
2019-05-02 18:11:36 +02:00
Andreas Kling
b4e7925e31 LibC: Move full ChunkedBlocks to a separate list in the allocator.
This way we only check actually usable blocks when trying to satisfy a new
allocation request.
2019-05-02 17:06:05 +02:00
Andreas Kling
60023ff70b LibC: free() should move kept empty ChunkedBlocks to the end of the list.
This ensures that we continue allocating from partially-used blocks until
they are full.
2019-05-02 16:35:57 +02:00
Andreas Kling
658fff195c LibC: free() should return free blocks back to the operating system.
Okay fine, I'll give them back. But we'll keep 4 blocks per size class on
hand, to reduce churn.
2019-05-02 15:58:10 +02:00
Andreas Kling
2dc72bb297 LibC: Improve malloc() mmap names somewhat. 2019-05-02 02:58:06 +02:00
Andreas Kling
4291e96991 LibC: Implement a simple freelist-based malloc() with size classes.
It's not thread-safe yet, and there is lots of room for improvement.
Still it's a lot faster than the first-fit bitmap-based one it replaces.
2019-05-02 02:35:29 +02:00