Skip to content
  • mrowe@apple.com's avatar
    Prepration for returning memory to the OS on Windows. Track whether a portion... · 20c85fe3
    mrowe@apple.com authored
    Prepration for returning memory to the OS on Windows.  Track whether a portion of a span of memory was returned to the OS.
    If it was, ask that it be recommitted before returning it to the application as an allocated region.
    
    Reviewed by Oliver Hunt.
    
    * wtf/FastMalloc.cpp:
    (WTF::TCMalloc_PageHeap::New):  If the span was decommitted, ask that it be recommitted before returning it.
    (WTF::TCMalloc_PageHeap::AllocLarge):  Ditto.
    (WTF::TCMalloc_PageHeap::Carve):  When splitting a span, ensure that the decommitted state propogates to the two new spans.
    (WTF::TCMalloc_PageHeap::Delete):  When merging a span, ensure that the resulting span is marked as decommitted if any of the
    spans being merged were marked as decommitted.
    (WTF::TCMalloc_PageHeap::IncrementalScavenge):  Mark as decommitted after releasing the span.
    (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Add an assertion to catch a decommitted span being returned to the application
    without first being recommitted.
    (WTF::TCMalloc_Central_FreeList::Populate): Ditto.
    * wtf/TCSystemAlloc.cpp: Stub out TCMalloc_SystemCommit.
    * wtf/TCSystemAlloc.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    20c85fe3