From 972811aa87d9e52a371f1147e20283631df6ebd5 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Fri, 1 Mar 2002 23:47:50 +0000 Subject: [PATCH] bug 127959 Increasing buckets from 6 to 9. Fixing free mismatch on gs->hold. r=pavlov, sr=alecf, a=asa@mozilla.org --- modules/libpr0n/decoders/gif/GIF2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/libpr0n/decoders/gif/GIF2.cpp b/modules/libpr0n/decoders/gif/GIF2.cpp index 359bc4c09dff..b7be1354e7db 100644 --- a/modules/libpr0n/decoders/gif/GIF2.cpp +++ b/modules/libpr0n/decoders/gif/GIF2.cpp @@ -91,7 +91,7 @@ mailing address. * and reuses them; automatically fails over to use calloc/free when all * buckets are full. */ -const int kGifAllocatorNBucket = 6; +const int kGifAllocatorNBucket = 9; nsRecyclingAllocator *gGifAllocator = nsnull; #define MAX_HOLD 768 /* for now must be big enough for a cmap */ @@ -460,7 +460,7 @@ static inline void * gif_calloc(size_t n, size_t s) { if (!gGifAllocator) - gGifAllocator = new nsRecyclingAllocator(kGifAllocatorNBucket); + gGifAllocator = new nsRecyclingAllocator(kGifAllocatorNBucket, NS_DEFAULT_RECYCLE_TIMEOUT, "gif"); if (gGifAllocator) return gGifAllocator->Calloc(n, s); else @@ -926,7 +926,7 @@ PRStatus gif_write(gif_struct *gs, const PRUint8 *buf, PRUint32 len) case gif_global_colormap: { -#ifdef DEBUG_dp +#if defined(DEBUG_dp) && 0 printf("DEBUG: global_colormap - %d [%d x %d]\n", gs->global_colormap_size * sizeof(GIF_RGB), gs->global_colormap_size, sizeof(GIF_RGB)); #endif @@ -1531,7 +1531,7 @@ gif_destroy(gif_struct *gs) gif_free(gs->prefix); gif_free(gs->suffix); gif_free(gs->stack); - gif_free(gs->hold); + PR_FREEIF(gs->hold); /* Free the colormap that is not in use. The other one, if * present, will be freed when the image container is