diff options
author | Jameson Miller <jamill@microsoft.com> | 2018-07-02 19:49:34 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 10:58:27 -0700 |
commit | 158dfeff3dc1d155b84e68b265a9b6c265717e1e (patch) | |
tree | bc4f3dee7fa51f28ea50645d59668a59799c2899 /fast-import.c | |
parent | mem-pool: only search head block for available space (diff) | |
download | tgif-158dfeff3dc1d155b84e68b265a9b6c265717e1e.tar.xz |
mem-pool: add life cycle management functions
Add initialization and discard functions to mem_pool type. As the
memory allocated by mem_pool can now be freed, we also track the large
allocations.
If the there are existing mp_blocks in the mem_poo's linked list of
mp_blocksl, then the mp_block for a large allocation is inserted
behind the head block. This is because only the head mp_block is considered
when searching for availble space. This results in the following
desirable properties:
1) The mp_block allocated for the large request will not be included
not included in the search for available in future requests, the large
mp_block is sized for the specific request and does not contain any
spare space.
2) The head mp_block will not bumped from considation for future
memory requests just because a request for a large chunk of memory
came in.
These changes are in preparation for a future commit that will utilize
creating and discarding memory pool.
Signed-off-by: Jameson Miller <jamill@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
0 files changed, 0 insertions, 0 deletions