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

    r52791 r73091  
    3939}
    4040
    41 void* MarkStack::allocateStack(size_t size)
    42 {
    43     return mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
    44 }
    45 void MarkStack::releaseStack(void* addr, size_t size)
    46 {
    47     munmap(addr, size);
    48 }
    49 
    5041}
    5142
Note: See TracChangeset for help on using the changeset viewer.