summaryrefslogtreecommitdiff
path: root/lib/slab.c
AgeCommit message (Collapse)Author
2022-03-09Revert "Multipage allocation"Maria Matejka
This reverts commit 6cd37713781a3092f8166b2178fae35cbfec1e28.
2021-10-13Multipage allocationMaria Matejka
We can also quite simply allocate bigger blocks. Anyway, we need these blocks to be aligned to their size which needs one mmap() two times bigger and then two munmap()s returning the unaligned parts. The user can specify -B <N> on startup when <N> is the exponent of 2, setting the block size to 2^N. On most systems, N is 12, anyway if you know that your configuration is going to eat gigabytes of RAM, you are almost forced to raise your block size as you may easily get into memory fragmentation issues or you have to raise your maximum mapping count, e.g. "sysctl vm.max_map_count=(number)".
2021-10-13fixup! Bound allocated pages to resource pools with page caches to avoid ↵Maria Matejka
unnecessary syscalls
2021-09-10Bound allocated pages to resource pools with page caches to avoid ↵Maria Matejka
unnecessary syscalls
2021-09-10Fixed memory poisoning in slabMaria Matejka
2021-03-25Slab: head now uses bitmask for used/free nodes info instead of listsMaria Matejka
From now, there are no auxiliary pointers stored in the free slab nodes. This led to strange debugging problems if use-after-free happened in slab-allocated structures, especially if the structure's first member is a next pointer. This also reduces the memory needed by 1 pointer per allocated object. OTOH, we now rely on pages being aligned to their size's multiple, which is quite common anyway.
2020-11-24lib/slab: introduce sl_allocz() function and use it in BabelToke Høiland-Jørgensen
The babel protocol code was initialising objects returned from the slab allocator by assigning to each of the struct members individually, but wasn't touching the NODE member while doing so. This leads to warnings on debug builds since commit: baac7009063d ("List expensive check.") To fix this, introduce an sl_allocz() variant of the slab allocator which will zero out the memory before returning it, and switch all the babel call sites to use this version. The overhead for doing this should be negligible for small objects, and in the case of babel, the largest object being allocated was being zeroed anyway, so we can drop the memset in babel_read_tlv().
2020-05-01Slab: Init node in slab head to NULLs.Maria Matejka
2015-06-08unsigned [int] -> uintPavel Tvrdík
2014-06-30Fixes integer overflow in show memory command.Ondrej Zajicek
Thanks to Job Snijders for the bugreport.
2012-01-03Fixes a tricky bug in route filtering.Ondrej Zajicek
Route attributes was used after rta was freed during copy-on-write in filter code. This causes some random crashes, esp. with multipath routes.
2010-06-02Implements command that shows memory usage.Ondrej Zajicek
2009-09-17Fixes headers for uintptr_t (and build on NetBSD).Ondrej Zajicek
2009-07-06Fixes memory alignment problems on Sparc64.Ondrej Zajicek
Not quite standard construction, i should add some autoconf macro. Not tested yet.
2004-06-05Staticized lots of local functions.Martin Mares
2000-06-07Fixes to the progdoc.Martin Mares
2000-06-05Documented memory resources.Martin Mares
2000-05-16Poisoning: take there...Martin Mares
2000-05-16Oops, the poison was too deadly...Martin Mares
2000-05-16Added poisoning of free'd objects when we're debugging.Martin Mares
2000-05-08Implemented debugging function rlookup() which you can call from gdbMartin Mares
to see what resource does the address given as a parameter belong to.
2000-03-31Include "lib/string.h" instead of <string.h>. It should give us bzero()Martin Mares
and other non-portable functions on all systems.
2000-03-05Implemented real slab allocator. If you suspect it from being buggy,Martin Mares
just #define FAKE_SLAB at the top of lib/slab.c to bypass it.
1998-05-24Staticized some variables and functions.Martin Mares
1998-05-03BIRD library: The story continues.Martin Mares
Complete resource manages and IP address handling.