Changeset 180954 in webkit


Ignore:
Timestamp:
Mar 3, 2015 1:58:02 PM (9 years ago)
Author:
ggaren@apple.com
Message:

bmalloc should implement malloc introspection (to stop false-positive leaks when MallocStackLogging is off)
https://bugs.webkit.org/show_bug.cgi?id=141802

Reviewed by Andreas Kling.

Rolling back in but disabled on iOS until I can debug why the iOS PLT crashes.

  • bmalloc/VMHeap.cpp:

(bmalloc::VMHeap::grow):

  • bmalloc/VMHeap.h:
  • bmalloc/Zone.cpp:

(bmalloc::Zone::size):
(bmalloc::Zone::Zone):

  • bmalloc/Zone.h:
Location:
trunk/Source/bmalloc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r180953 r180954  
     12015-03-03  Geoffrey Garen  <ggaren@apple.com>
     2
     3        bmalloc should implement malloc introspection (to stop false-positive leaks when MallocStackLogging is off)
     4        https://bugs.webkit.org/show_bug.cgi?id=141802
     5
     6        Reviewed by Andreas Kling.
     7
     8        Rolling back in but disabled on iOS until I can debug why the iOS PLT crashes.
     9
     10        * bmalloc/VMHeap.cpp:
     11        (bmalloc::VMHeap::grow):
     12        * bmalloc/VMHeap.h:
     13        * bmalloc/Zone.cpp:
     14        (bmalloc::Zone::size):
     15        (bmalloc::Zone::Zone):
     16        * bmalloc/Zone.h:
     17
    1182015-03-03  Geoffrey Garen  <ggaren@apple.com>
    219
  • trunk/Source/bmalloc/bmalloc/VMHeap.cpp

    r180797 r180954  
    4141{
    4242    SuperChunk* superChunk = SuperChunk::create();
    43 #if BPLATFORM(DARWIN)
     43#if BOS(DARWIN) && !BPLATFORM(IOS)
    4444    m_zone.addSuperChunk(superChunk);
    4545#endif
  • trunk/Source/bmalloc/bmalloc/VMHeap.h

    r180797 r180954  
    3636#include "SmallChunk.h"
    3737#include "Vector.h"
    38 #if BPLATFORM(DARWIN)
     38#if BOS(DARWIN) && !BPLATFORM(IOS)
    3939#include "Zone.h"
    4040#endif
     
    6767    Vector<MediumPage*> m_mediumPages;
    6868    SegregatedFreeList m_largeObjects;
    69 #if BPLATFORM(DARWIN)
     69#if BOS(DARWIN) && !BPLATFORM(IOS)
    7070    Zone m_zone;
    7171#endif
  • trunk/Source/bmalloc/bmalloc/Zone.cpp

    r180604 r180954  
    4343}
    4444
     45// Support malloc_zone_from_ptr, which calls size() on each registered zone.
     46size_t Zone::size(malloc_zone_t*, const void*)
     47{
     48    // Our zone is not public API, so no pointer can belong to us.
     49    return 0;
     50}
     51
    4552// This function runs inside the leaks process.
    4653kern_return_t Zone::enumerator(task_t task, void* context, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder)
     
    6471Zone::Zone()
    6572{
    66     version = 4;
    67     zone_name = "WebKit Malloc";
    68     introspect = &bmalloc::introspect;
     73    malloc_zone_t::size = size;
     74    malloc_zone_t::zone_name = "WebKit Malloc";
     75    malloc_zone_t::introspect = &bmalloc::introspect;
     76    malloc_zone_t::version = 4;
    6977    malloc_zone_register(this);
    7078}
  • trunk/Source/bmalloc/bmalloc/Zone.h

    r180604 r180954  
    3939    static const size_t capacity = 2048;
    4040
     41    static size_t size(malloc_zone_t*, const void*);
    4142    static kern_return_t enumerator(task_t, void* context, unsigned type_mask, vm_address_t, memory_reader_t, vm_range_recorder_t);
    4243
Note: See TracChangeset for help on using the changeset viewer.