From ac8dccabe25622de2672204e54e7c8610d14bce4 Mon Sep 17 00:00:00 2001 From: Norbert Leser Date: Thu, 20 Aug 2009 11:34:40 +0200 Subject: Fix JavaScriptCore build on systems without anonymous mmapping Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled RegisterFile constructor currently throws #error when both MMAP and VIRTUALALLOC conditions fail. On any platform that does not provide these features (for instance, Symbian), the fallback should be regular malloc (or fastMalloc). It is functionally equivalent in this case, even though it may have certain drawbacks such as lack of dynamic pre-allocation. Taken upstream from https://bugs.webkit.org/show_bug.cgi?id=27051 Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp | 2 +- src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp index cfcf1d3..06ddefc 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp @@ -38,7 +38,7 @@ RegisterFile::~RegisterFile() #elif HAVE(VIRTUALALLOC) VirtualFree(m_buffer, 0, MEM_RELEASE); #else - #error "Don't know how to release virtual memory on this platform." + fastFree(m_buffer); #endif } diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h index d46bdc9..5a34d11 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h @@ -204,8 +204,8 @@ namespace JSC { CRASH(); } m_commitEnd = reinterpret_cast(reinterpret_cast(m_buffer) + committedSize); - #else - #error "Don't know how to reserve virtual memory on this platform." + #else // Neither MMAP nor VIRTUALALLOC - use fastMalloc instead + m_buffer = static_cast(fastMalloc(bufferLength)); #endif m_start = m_buffer + maxGlobals; m_end = m_start; -- cgit v0.12