From e185ad09c4dfb730836c9e140fa7952275cfeb1d Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Wed, 18 Jan 2012 18:55:01 -0800 Subject: [PATCH] Bug 719315: Free unused chunks. (r=luke, a=akeybl) --- js/src/ds/LifoAlloc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index 7c814ae8e0856..b625943f4c30c 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -143,8 +143,12 @@ LifoAlloc::freeUnused() } /* Free all chunks after |latest|. */ - for (BumpChunk *victim = latest->next(); victim; victim = victim->next()) + BumpChunk *it = latest->next(); + while (it) { + BumpChunk *victim = it; + it = it->next(); BumpChunk::delete_(victim); + } latest->setNext(NULL); }