From: Mike Pall Date: Thu, 16 Aug 2012 11:18:40 +0000 (+0200) Subject: Fix shrinking of direct mapped block in builtin allocator. X-Git-Tag: v2.0.0-beta11~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d61e9e5d895fcf9443bd02a7a8dedcd41dd700a6;p=thirdparty%2FLuaJIT.git Fix shrinking of direct mapped block in builtin allocator. --- diff --git a/src/lj_alloc.c b/src/lj_alloc.c index e4ce7634..82b4e5b1 100644 --- a/src/lj_alloc.c +++ b/src/lj_alloc.c @@ -752,7 +752,7 @@ static mchunkptr direct_resize(mchunkptr oldp, size_t nb) return NULL; /* Keep old chunk if big enough but not too big */ if (oldsize >= nb + SIZE_T_SIZE && - (oldsize - nb) <= (DEFAULT_GRANULARITY << 1)) { + (oldsize - nb) <= (DEFAULT_GRANULARITY >> 1)) { return oldp; } else { size_t offset = oldp->prev_foot & ~IS_DIRECT_BIT;