From 61632073ac9473e00d5e0c88078880d3af575828 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Oct 2002 23:42:37 +0300 Subject: Allocate HEAP blocks in smaller blocks to get better memory utilization and more speed when used with safemalloc. Don't initalize memory areas when run with --skip-safemalloc. Docs/manual.texi: ChangeLog heap/heapdef.h: Allocate HEAP blocks in smaller blocks to get better memory utilization and more speed when used with safemalloc. heap/hp_open.c: Allocate HEAP blocks in smaller blocks to get better memory utilization and more speed when used with safemalloc. mysys/safemalloc.c: Don't initalize memory areas when run with --skip-safemalloc. This can in some cases increase speed with 20 times when debugging --- mysys/safemalloc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mysys') diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 34fcfff756c..0bf9341e3c1 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -194,9 +194,7 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags) pthread_mutex_unlock(&THR_LOCK_malloc); /* Set the memory to the aribtrary wierd value */ -#ifdef HAVE_purify - if (MyFlags & MY_ZEROFILL) -#endif + if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) bfill(&pTmp -> aData[sf_malloc_prehunc],uSize, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); /* Return a pointer to the real data */ @@ -315,7 +313,8 @@ void _myfree (gptr pPtr, const char *sFile, uint uLine, myf myflags) #ifndef HAVE_purify /* Mark this data as free'ed */ - bfill(&pRec->aData[sf_malloc_prehunc],pRec->uDataSize,(pchar) FREE_VAL); + if (!sf_malloc_quick) + bfill(&pRec->aData[sf_malloc_prehunc],pRec->uDataSize,(pchar) FREE_VAL); #endif *((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc)) = ~MAGICKEY; -- cgit v1.2.1