tests/core/pool.c


Log

Author Commit Date CI Message
Ross Delinger ed0571f8 2016-01-12T16:08:38 Add a new build flag to disable the pool allocator and pass all git_pool_malloc calls straight to git__malloc
Vicent Marti 7ff7ca62 2015-11-12T20:51:01 pool: Never return unaligned buffers
Vicent Marti 66eb7660 2015-10-28T10:29:00 pool: Handle 32 bit systems
Vicent Marti 1e5e02b4 2015-10-27T17:26:04 pool: Simplify implementation
Russell Belfer 5fa8cda9 2014-06-30T12:05:25 Round up pool alloc sizes for alignment To make sure that items returned from pool allocations are aligned on nice boundaries, this rounds up all pool allocation sizes to a multiple of 8. This adds a small amount of overhead to each item. The rounding up could be made optional with an extra parameter to the pool initialization that turned on rounding only for pools where item alignment actually matters, but I think for the extra code and complexity that would be involved, that it makes sense just to burn a little bit of extra memory and enable this all the time.
Vicent Marti 7a16d54b 2013-12-13T12:47:51 pool: Agh, this test doesn't really apply in 32-bit machines The size_t is 32-bit already, so it overflows before going into the function. The `-1` test should handle this gracefully in both cases anyway.
Vicent Marti 437f7d69 2013-12-13T12:41:22 pool: Correct overflow checks Ok, scrap the previous commit. This is the right overflow check that takes care of 64 bit overflow **and** 32-bit overflow, which needs to be considered because the pool malloc can only allocate 32-bit elements in one go.
Ben Straub 17820381 2013-11-14T14:05:52 Rename tests-clar to tests