From: Ivailo Monev Date: Sun, 15 Nov 2020 21:29:31 +0000 (+0200) Subject: JSC FastMalloc cleanup X-Git-Tag: 4.12.0~3365 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=33b932887d60b574237faedfc3a9482f9c6ec168;p=kde%2FKatie.git JSC FastMalloc cleanup Signed-off-by: Ivailo Monev --- diff --git a/src/3rdparty/javascriptcore/wtf/FastMalloc.cpp b/src/3rdparty/javascriptcore/wtf/FastMalloc.cpp index 9901a9133..55a21a385 100644 --- a/src/3rdparty/javascriptcore/wtf/FastMalloc.cpp +++ b/src/3rdparty/javascriptcore/wtf/FastMalloc.cpp @@ -80,28 +80,6 @@ #include "Assertions.h" #include -#ifndef QT_NO_DEBUG -namespace WTF { - -static bool staticIsForbidden; -static bool isForbidden() -{ - return staticIsForbidden; -} - -void fastMallocForbid() -{ - staticIsForbidden = true; -} - -void fastMallocAllow() -{ - staticIsForbidden = false; -} - -} // namespace WTF -#endif // QT_NO_DEBUG - namespace WTF { void* fastZeroedMalloc(size_t n) @@ -111,45 +89,16 @@ void* fastZeroedMalloc(size_t n) return result; } -} // namespace WTF - -namespace WTF { - -void* tryFastMalloc(size_t n) -{ - Q_ASSERT(!isForbidden()); - - return malloc(n); -} - void* fastMalloc(size_t n) { - Q_ASSERT(!isForbidden()); - void* result = malloc(n); if (!result) CRASH(); return result; } -void fastFree(void* p) -{ - Q_ASSERT(!isForbidden()); - - free(p); -} - -void* tryFastRealloc(void* p, size_t n) -{ - Q_ASSERT(!isForbidden()); - - return realloc(p, n); -} - void* fastRealloc(void* p, size_t n) { - Q_ASSERT(!isForbidden()); - void* result = realloc(p, n); if (!result) CRASH(); diff --git a/src/3rdparty/javascriptcore/wtf/FastMalloc.h b/src/3rdparty/javascriptcore/wtf/FastMalloc.h index 8fda3802f..e8d6efa0f 100644 --- a/src/3rdparty/javascriptcore/wtf/FastMalloc.h +++ b/src/3rdparty/javascriptcore/wtf/FastMalloc.h @@ -32,15 +32,10 @@ namespace WTF { void* fastZeroedMalloc(size_t); void* fastRealloc(void*, size_t); - void* tryFastMalloc(size_t n); - void* tryFastRealloc(void* p, size_t n); + inline void* tryFastMalloc(size_t n) { return ::malloc(n); }; + inline void* tryFastRealloc(void* p, size_t n) { return ::realloc(p, n); }; - void fastFree(void*); - -#ifndef QT_NO_DEBUG - void fastMallocForbid(); - void fastMallocAllow(); -#endif + inline void fastFree(void* p) { ::free(p); }; } // namespace WTF using WTF::fastMalloc; @@ -50,9 +45,4 @@ using WTF::tryFastMalloc; using WTF::tryFastRealloc; using WTF::fastFree; -#ifndef QT_NO_DEBUG -using WTF::fastMallocForbid; -using WTF::fastMallocAllow; -#endif - #endif /* WTF_FastMalloc_h */ diff --git a/src/3rdparty/javascriptcore/wtf/Platform.h b/src/3rdparty/javascriptcore/wtf/Platform.h index ec88cce80..24f3cf72e 100644 --- a/src/3rdparty/javascriptcore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/wtf/Platform.h @@ -329,7 +329,6 @@ QT_USE_NAMESPACE #define HAVE_SIGNAL_H 1 #define HAVE_LANGINFO_H 1 #define HAVE_MMAP 1 -#define HAVE_SBRK 1 #define HAVE_STRINGS_H 1 #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_TIME_H 1