From 4bf57c6ce440c55bf80220a345b81e26767b9621 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 18 Dec 2014 15:40:12 -0500 Subject: [PATCH] fix StackSpace to use new stack location scheme. --- toolbox/mm.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/toolbox/mm.cpp b/toolbox/mm.cpp index 1c56b37..d2d75b0 100644 --- a/toolbox/mm.cpp +++ b/toolbox/mm.cpp @@ -747,17 +747,9 @@ namespace MM SetMemError(0); - // find the pointer base... - // todo -- call lower bound, then iter-- ? - for (const auto & iter : PtrMap) - { - if (sp >= iter.first && sp < iter.first + iter.second) - { - return sp - iter.first; - } - } + // MemorySize is the top of the heap. stack is after it. - return 0; + return sp - MemorySize; }