Ignore:
Timestamp:
Jun 23, 2008, 10:34:24 PM (17 years ago)
Author:
[email protected]
Message:

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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/TCSystemAlloc.h

    r28434 r34756  
    6363extern void TCMalloc_SystemRelease(void* start, size_t length);
    6464
     65#if HAVE(VIRTUALALLOC)
     66extern void TCMalloc_SystemCommit(void* start, size_t length);
     67#else
     68inline void TCMalloc_SystemCommit(void*, size_t) { }
     69#endif
     70
    6571#endif /* TCMALLOC_SYSTEM_ALLOC_H__ */
Note: See TracChangeset for help on using the changeset viewer.