Ignore:
Timestamp:
Sep 10, 2007, 5:16:51 PM (18 years ago)
Author:
thatcher
Message:

Reviewed by Darin Adler.

<rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37

Removed the implementation of these malloc zone functions. We do not have the ability to
check if a pointer is valid or not, so we can't correctly implement them. The system free
does not fail if you pass in a bad pointer.

  • wtf/FastMalloc.cpp: (WTF::FastMallocZone::size): (WTF::FastMallocZone::zoneMalloc): (WTF::FastMallocZone::zoneCalloc): (WTF::FastMallocZone::zoneFree): (WTF::FastMallocZone::zoneRealloc):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r25422 r25483  
    26152615}
    26162616
    2617 
    2618 size_t FastMallocZone::size(malloc_zone_t* zone, const void* ptr)
     2617size_t FastMallocZone::size(malloc_zone_t*, const void*)
    26192618{
    2620     if (!ptr || !pageheap)
    2621         return 0;
    2622 
    2623     const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
    2624     Span* span = pageheap->GetDescriptorEnsureSafe(p);
    2625     if (!span)
    2626         return 0;
    2627 
    2628     if (span->sizeclass == 0)
    2629         return span->length * kPageSize;
    2630 
    2631     return ByteSizeForClass(span->sizeclass);
    2632 }
    2633 
    2634 void* FastMallocZone::zoneMalloc(malloc_zone_t* zone, size_t size)
     2619    return 0;
     2620}
     2621
     2622void* FastMallocZone::zoneMalloc(malloc_zone_t*, size_t)
    26352623{
    2636     return fastMalloc(size);
    2637 }
    2638 
    2639 void* FastMallocZone::zoneCalloc(malloc_zone_t*, size_t numItems, size_t size)
     2624    return 0;
     2625}
     2626
     2627void* FastMallocZone::zoneCalloc(malloc_zone_t*, size_t, size_t)
    26402628{
    2641     return fastCalloc(numItems, size);
    2642 }
    2643 
    2644 void FastMallocZone::zoneFree(malloc_zone_t*, void* ptr)
     2629    return 0;
     2630}
     2631
     2632void FastMallocZone::zoneFree(malloc_zone_t*, void*)
    26452633{
    2646     return fastFree(ptr);
    2647 }
    2648 
    2649 void* FastMallocZone::zoneRealloc(malloc_zone_t*, void* ptr, size_t size)
     2634}
     2635
     2636void* FastMallocZone::zoneRealloc(malloc_zone_t*, void*, size_t)
    26502637{
    2651     return fastRealloc(ptr, size);
     2638    return 0;
    26522639}
    26532640
Note: See TracChangeset for help on using the changeset viewer.