From b9b42ee01c935133c025d3b20102c1e490354e8e Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Mon, 16 Aug 2010 23:06:55 -0700 Subject: Replace divide and multiply with mask in sYSTRIm --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'malloc/malloc.c') diff --git a/malloc/malloc.c b/malloc/malloc.c index 9594be4cbd..53ee1ccb87 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3466,7 +3466,7 @@ static int sYSTRIm(pad, av) size_t pad; mstate av; top_size = chunksize(av->top); /* Release in pagesize units, keeping at least one page */ - extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz; + extra = (top_size - pad - MINSIZE - 1) & ~(pagesz - 1); if (extra > 0) { -- cgit v1.2.3