From 6f38d1baa1d6c735ae12b571dd341cd431f6ba73 Mon Sep 17 00:00:00 2001 From: degasus Date: Wed, 15 Jul 2015 08:53:05 +0200 Subject: CodeBlock: Add a shared IsAlmostFull function This function shall keep care about the low watermark of code space. If we ran out of space, the JITs shall clear their block cache. --- Source/Core/Common/CodeBlock.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/Common/CodeBlock.h') diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index 972fc707d6..5699fc5385 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -72,5 +72,11 @@ public: { return region_size - (T::GetCodePtr() - region); } + + bool IsAlmostFull() const + { + // This should be bigger than the biggest block ever. + return GetSpaceLeft() < 0x10000; + } }; -- cgit v1.2.3