From 25563eaab1ed5f9762075c6beba3efefbb847f1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 14 Jan 2013 16:15:01 +0100 Subject: [PATCH] There is no point in checking twice for a space if gc was not run. Change-Id: I60234eaba3db7ee6c52b4487a12e403116dbf254 Reviewed-by: Lars Knoll --- qv4mm.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qv4mm.cpp b/qv4mm.cpp index a05e593..fd7d86a 100644 --- a/qv4mm.cpp +++ b/qv4mm.cpp @@ -123,12 +123,12 @@ Managed *MemoryManager::alloc(std::size_t size) goto found; // try to free up space, otherwise allocate - if (!m_d->aggressiveGC) + if (!m_d->aggressiveGC) { runGC(); - - m = m_d->smallItems[pos]; - if (m) - goto found; + m = m_d->smallItems[pos]; + if (m) + goto found; + } // no free item available, allocate a new chunk { -- 2.7.4