Commit 0aaef196 authored by zoltan@webkit.org's avatar zoltan@webkit.org
Browse files

2009-10-01 Zoltan Horvath <zoltan@webkit.org>

        Reviewed by Simon Hausmann.

        [Qt] Allow custom memory allocation control for the whole JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=27029

        Since in JavaScriptCore almost every class which has been instantiated by operator new is
        inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
        when USE_SYSTEM_MALLOC=0.

        Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
        (It's needed for the functionality of TCmalloc.)

        Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.

        * JavaScriptCore.pri:
        * wtf/FastMalloc.cpp:
        (WTF::sleep):
        * wtf/FastMalloc.h:

2009-10-01  Zoltan Horvath  <zoltan@webkit.org>

        Reviewed by Simon Hausmann.

        [Qt] Don't use TCmalloc in DumpRenderTree
        https://bugs.webkit.org/show_bug.cgi?id=27029

        Add USE_SYSTEM_MALLOC macro to the DRT's profile to avoid using TCmalloc in Qt's DRT.

        * DumpRenderTree/qt/DumpRenderTree.pro:

2009-10-01  Zoltan Horvath  <zoltan@webkit.org>

        Reviewed by Simon Hausmann.

        [Qt] Enable TCmalloc for the Linux, Mac and Windows Qt-port
        https://bugs.webkit.org/show_bug.cgi?id=27029

        Remove USE_SYSTEM_MALLOC for Linux, Mac and Windows Qt-port from WebKit.pri,
        so these Qt-ports will use TCmalloc as other ports.

        * WebKit.pri:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 80aa186c
2009-10-01 Zoltan Horvath <zoltan@webkit.org>
Reviewed by Simon Hausmann.
[Qt] Enable TCmalloc for the Linux, Mac and Windows Qt-port
https://bugs.webkit.org/show_bug.cgi?id=27029
Remove USE_SYSTEM_MALLOC for Linux, Mac and Windows Qt-port from WebKit.pri,
so these Qt-ports will use TCmalloc as other ports.
* WebKit.pri:
2009-10-01 Martin Robinson <martin.james.robinson@gmail.com>
Reviewed by Xan Lopez.
......
2009-10-01 Zoltan Horvath <zoltan@webkit.org>
Reviewed by Simon Hausmann.
[Qt] Allow custom memory allocation control for the whole JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=27029
Since in JavaScriptCore almost every class which has been instantiated by operator new is
inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
when USE_SYSTEM_MALLOC=0.
Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
(It's needed for the functionality of TCmalloc.)
Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
* JavaScriptCore.pri:
* wtf/FastMalloc.cpp:
(WTF::sleep):
* wtf/FastMalloc.h:
2009-09-30 Gabor Loki <loki@inf.u-szeged.hu>
Reviewed by George Staikos.
......
......@@ -140,6 +140,10 @@ symbian {
}
}
!contains(DEFINES, USE_SYSTEM_MALLOC) {
SOURCES += wtf/TCSystemAlloc.cpp
}
# AllInOneFile.cpp helps gcc analize and optimize code
# Other compilers may be able to do this at link time
SOURCES += \
......
......@@ -379,6 +379,9 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#if PLATFORM(UNIX)
#include <unistd.h>
#endif
#if COMPILER(MSVC)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
......@@ -2274,7 +2277,7 @@ static inline TCMalloc_PageHeap* getPageHeap()
#define pageheap getPageHeap()
#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
#if PLATFORM(WIN)
#if PLATFORM(WIN_OS)
static void sleep(unsigned seconds)
{
::Sleep(seconds * 1000);
......
......@@ -213,6 +213,9 @@ using WTF::fastMallocAllow;
// debug-only code to make sure we don't use the system malloc via the default operator
// new by accident.
// We musn't customize the global operator new and delete for the Qt port.
#if !PLATFORM(QT)
WTF_PRIVATE_INLINE void* operator new(size_t size) { return fastMalloc(size); }
WTF_PRIVATE_INLINE void* operator new(size_t size, const std::nothrow_t&) throw() { return fastMalloc(size); }
WTF_PRIVATE_INLINE void operator delete(void* p) { fastFree(p); }
......@@ -224,4 +227,6 @@ WTF_PRIVATE_INLINE void operator delete[](void* p, const std::nothrow_t&) throw(
#endif
#endif
#endif /* WTF_FastMalloc_h */
......@@ -31,7 +31,10 @@ building-libs {
DEPENDPATH += $$PWD/WebKit/qt/Api
}
DEFINES += USE_SYSTEM_MALLOC
!win32:!mac:!unix {
DEFINES += USE_SYSTEM_MALLOC
}
CONFIG(release, debug|release) {
DEFINES += NDEBUG
}
......
2009-10-01 Zoltan Horvath <zoltan@webkit.org>
Reviewed by Simon Hausmann.
[Qt] Don't use TCmalloc in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=27029
Add USE_SYSTEM_MALLOC macro to the DRT's profile to avoid using TCmalloc in Qt's DRT.
* DumpRenderTree/qt/DumpRenderTree.pro:
2009-10-01 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
......
......@@ -22,3 +22,5 @@ unix:!mac {
lessThan(QT_MINOR_VERSION, 4) {
DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE=""
}
DEFINES+=USE_SYSTEM_MALLOC
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment