server-skynet-source-3rd-je.../include/jemalloc
Daniel Micay 879e76a9e5 teach the dss chunk allocator to handle new_addr
This provides in-place expansion of huge allocations when the end of the
allocation is at the end of the sbrk heap. There's already the ability
to extend in-place via recycled chunks but this handles the initial
growth of the heap via repeated vector / string reallocations.

A possible future extension could allow realloc to go from the following:

    | huge allocation | recycled chunks |
                                        ^ dss_end

To a larger allocation built from recycled *and* new chunks:

    |                      huge allocation                      |
                                                                ^ dss_end

Doing that would involve teaching the chunk recycling code to request
new chunks to satisfy the request. The chunk_dss code wouldn't require
any further changes.

    #include <stdlib.h>

    int main(void) {
        size_t chunk = 4 * 1024 * 1024;
        void *ptr = NULL;
        for (size_t size = chunk; size < chunk * 128; size *= 2) {
            ptr = realloc(ptr, size);
            if (!ptr) return 1;
        }
    }

dss:secondary: 0.083s
dss:primary: 0.083s

After:

dss:secondary: 0.083s
dss:primary: 0.003s

The dss heap grows in the upwards direction, so the oldest chunks are at
the low addresses and they are used first. Linux prefers to grow the
mmap heap downwards, so the trick will not work in the *current* mmap
chunk allocator as a huge allocation will only be at the top of the heap
in a contrived case.
2014-11-28 16:11:19 -08:00
..
internal teach the dss chunk allocator to handle new_addr 2014-11-28 16:11:19 -08:00
jemalloc_defs.h.in Remove the *allocm() API, which is superceded by the *allocx() API. 2014-04-14 22:32:31 -07:00
jemalloc_macros.h.in Add missing header includes in jemalloc/jemalloc.h . 2014-10-05 12:05:37 -07:00
jemalloc_mangle.sh Fix name mangling for stress tests. 2014-01-16 17:38:01 -08:00
jemalloc_protos.h.in Add support for sized deallocation. 2014-09-08 17:34:24 -07:00
jemalloc_rename.sh Fix name mangling for stress tests. 2014-01-16 17:38:01 -08:00
jemalloc_typedefs.h.in Attempt to expand huge allocations in-place. 2014-10-05 14:47:01 -07:00
jemalloc.sh Move typedefs from jemalloc_protos.h.in to jemalloc_typedefs.h.in. 2014-09-07 19:55:03 -07:00