Ignore:
Timestamp:
Dec 1, 2010, 6:13:59 PM (14 years ago)
Author:
[email protected]
Message:

Baby step toward a cross-platform virtual memory abstraction: created
an all-static OSAllocator class and changed MarkStack to use it.

Reviewed by Sam Weinig.

  • JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp.
  • runtime/MarkStack.h:

(JSC::MarkStack::allocateStack):
(JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our
own platform-specific code.

  • runtime/MarkStackNone.cpp: Removed. Nothing used this.
  • runtime/MarkStackPosix.cpp:
  • runtime/MarkStackSymbian.cpp:
  • runtime/MarkStackWin.cpp: Removed custom platform-specific code, since

we use the OSAllocator abstraction now.

  • wtf/OSAllocator.h: Added.
  • wtf/OSAllocatorPosix.cpp: Added.

(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit):
(WTF::OSAllocator::decommit):
(WTF::OSAllocator::release):

  • wtf/OSAllocatorSymbian.cpp: Added.

(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit):
(WTF::OSAllocator::decommit):
(WTF::OSAllocator::release):

  • wtf/OSAllocatorWin.cpp: Added.

(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit):
(WTF::OSAllocator::decommit):
(WTF::OSAllocator::release): The new OSAllocator abstraction.

  • wtf/wtf.pri: Added OSAllocatorSymbian.cpp.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/MarkStack.h

    r64684 r73091  
    2929#include "JSValue.h"
    3030#include <wtf/Noncopyable.h>
     31#include <wtf/OSAllocator.h>
    3132
    3233namespace JSC {
     
    8687        };
    8788
    88         static void* allocateStack(size_t size);
    89         static void releaseStack(void* addr, size_t size);
     89        static void* allocateStack(size_t size) { return OSAllocator::reserveAndCommit(size); }
     90        static void releaseStack(void* addr, size_t size) { OSAllocator::release(addr, size); }
    9091
    9192        static void initializePagesize();
Note: See TracChangeset for help on using the changeset viewer.