• Ell's avatar
    app: add gimp-scratch allocator · a8a86552
    Ell authored
    gimp-scratch is a fast memory allocator (on the order of magnitude
    of alloca()), suitable for small (up to a few megabytes), short-
    lived (usually, bound to the current stack-frame) allocations.
    Unlike alloca(), gimp-scratch doesn't use the stack, and is
    therefore safer, and will also serve bigger requests, by falling-
    back to malloc().
    
    The allocator itself is very simple:  We keep a per-thread stack of
    cached memory blocks (allocated using the normal allocator).  When
    serving an allocation request, we simply pop the top block off the
    stack, and return it. If the block is too small, we replace it with
    a big-enough block.  When the block is freed, we push it back to
    the top of the stack (note that even though each thread uses a
    separate stack, blocks can be migrated between threads, i.e.,
    allocated on one thread, and freed on another thread, although this
    is not really an intended usage pattern.)  The idea is that the
    stacks will ultimately stabalize to contain blocks that can serve
    all the encountered allocation patterns, without needing to reisze
    any of the blocks; as a consequence, the amount of scratch memory
    allocated at any given time should really be kept to a minimum.
    a8a86552
Name
Last commit
Last update
..
actions Loading commit data...
config Loading commit data...
core Loading commit data...
dialogs Loading commit data...
display Loading commit data...
file Loading commit data...
gegl Loading commit data...
gui Loading commit data...
menus Loading commit data...
operations Loading commit data...
paint Loading commit data...
pdb Loading commit data...
plug-in Loading commit data...
propgui Loading commit data...
tests Loading commit data...
text Loading commit data...
tools Loading commit data...
vectors Loading commit data...
widgets Loading commit data...
xcf Loading commit data...
.gitignore Loading commit data...
Makefile.am Loading commit data...
about.h Loading commit data...
app.c Loading commit data...
app.h Loading commit data...
errors.c Loading commit data...
errors.h Loading commit data...
gimp-debug.c Loading commit data...
gimp-debug.h Loading commit data...
gimp-intl.h Loading commit data...
gimp-log.c Loading commit data...
gimp-log.h Loading commit data...
gimp-priorities.h Loading commit data...
gimp-version.c Loading commit data...
gimp-version.h Loading commit data...
gimpcore.def Loading commit data...
language.c Loading commit data...
language.h Loading commit data...
main.c Loading commit data...
sanity.c Loading commit data...
sanity.h Loading commit data...
signals.c Loading commit data...
signals.h Loading commit data...
tests.c Loading commit data...
tests.h Loading commit data...
unique.c Loading commit data...
unique.h Loading commit data...