• 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
.gitlab Loading commit data...
app Loading commit data...
app-tools Loading commit data...
build Loading commit data...
cursors Loading commit data...
data Loading commit data...
desktop Loading commit data...
devel-docs Loading commit data...
docs Loading commit data...
etc Loading commit data...
icons Loading commit data...
libgimp Loading commit data...
libgimpbase Loading commit data...
libgimpcolor Loading commit data...
libgimpconfig Loading commit data...
libgimpmath Loading commit data...
libgimpmodule Loading commit data...
libgimpthumb Loading commit data...
libgimpwidgets Loading commit data...
m4macros Loading commit data...
menus Loading commit data...
modules Loading commit data...
pdb Loading commit data...
plug-ins Loading commit data...
po Loading commit data...
po-libgimp Loading commit data...
po-plug-ins Loading commit data...
po-python Loading commit data...
po-script-fu Loading commit data...
po-tags Loading commit data...
po-tips Loading commit data...
po-windows-installer Loading commit data...
themes Loading commit data...
tools Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.kateconfig Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog.pre-1-0 Loading commit data...
ChangeLog.pre-1-2 Loading commit data...
ChangeLog.pre-2-0 Loading commit data...
ChangeLog.pre-2-2 Loading commit data...
ChangeLog.pre-2-4 Loading commit data...
ChangeLog.pre-2-6 Loading commit data...
ChangeLog.pre-git Loading commit data...
HACKING Loading commit data...
INSTALL.in Loading commit data...
LICENSE Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
NEWS.pre-2-0 Loading commit data...
NEWS.pre-2-10 Loading commit data...
NEWS.pre-2-2 Loading commit data...
NEWS.pre-2-4 Loading commit data...
NEWS.pre-2-6 Loading commit data...
NEWS.pre-2-8 Loading commit data...
README Loading commit data...
README.i18n Loading commit data...
acinclude.m4 Loading commit data...
authors.dtd Loading commit data...
authors.xml Loading commit data...
authors.xsl Loading commit data...
authors4gimp-web.xsl Loading commit data...
autogen.sh Loading commit data...
config.h.win32 Loading commit data...
configure.ac Loading commit data...
gimp-zip.in Loading commit data...
gimp.doap Loading commit data...
gimp.pc.in Loading commit data...
gimpthumb.pc.in Loading commit data...
gimpui.pc.in Loading commit data...