mirror of https://github.com/GNOME/gimp.git
when glibc is used, call mallopt, so that memory chunks >= 4k (= 64*64
2004-04-29 Simon Budig <simon@gimp.org> * app/main.c: when glibc is used, call mallopt, so that memory chunks >= 4k (= 64*64 pixels, 1bpp - the smallest full tile) get allocated via mmap. This ensures that after closing an image the memory allocated for image data gets returned to the system. Thanks to Phil Blundell <pb@nexus.co.uk> for bringing mallopt to my attention. Please watch closely for performance problems.
This commit is contained in:
parent
f1252babb1
commit
656795fac0
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2004-04-29 Simon Budig <simon@gimp.org>
|
||||||
|
|
||||||
|
* app/main.c: when glibc is used, call mallopt, so that memory
|
||||||
|
chunks >= 4k (= 64*64 pixels, 1bpp - the smallest full tile)
|
||||||
|
get allocated via mmap. This ensures that after closing an image
|
||||||
|
the memory allocated for image data gets returned to the system.
|
||||||
|
|
||||||
|
Thanks to Phil Blundell <pb@nexus.co.uk> for bringing mallopt
|
||||||
|
to my attention.
|
||||||
|
|
||||||
|
Please watch closely for performance problems.
|
||||||
|
|
||||||
2004-04-29 Michael Natterer <mitch@gimp.org>
|
2004-04-29 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/actions/Makefile.am
|
* app/actions/Makefile.am
|
||||||
|
|
11
app/main.c
11
app/main.c
|
@ -32,6 +32,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WAIT_ANY
|
#ifndef WAIT_ANY
|
||||||
#define WAIT_ANY -1
|
#define WAIT_ANY -1
|
||||||
#endif
|
#endif
|
||||||
|
@ -240,6 +244,13 @@ main (int argc,
|
||||||
use_shm = TRUE;
|
use_shm = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
|
/* Tweak memory allocation so that memory allocated in chunks >= 4k
|
||||||
|
* (64x64 pixel 1bpp tile) gets returned to the system when free'd ().
|
||||||
|
*/
|
||||||
|
mallopt (M_MMAP_THRESHOLD, 64 * 64 - 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
batch_cmds = g_new (gchar *, argc);
|
batch_cmds = g_new (gchar *, argc);
|
||||||
batch_cmds[0] = NULL;
|
batch_cmds[0] = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue