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/MarkStackWin.cpp

    r52791 r73091  
    4040}
    4141
    42 void* MarkStack::allocateStack(size_t size)
    43 {
    44     return VirtualAlloc(0, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    45 }
    46 void MarkStack::releaseStack(void* addr, size_t)
    47 {
    48     // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx,
    49     // dwSize must be 0 if dwFreeType is MEM_RELEASE.
    50     VirtualFree(addr, 0, MEM_RELEASE);
    51 }
    52 
    5342}
    5443
Note: See TracChangeset for help on using the changeset viewer.