Ignore:
Timestamp:
Aug 10, 2009, 4:17:34 PM (16 years ago)
Author:
[email protected]
Message:

Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.

Reviewed by Darin Adler.

  • wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since

we implement the nothrow variants of new and new[]. The nothrow variant of delete is called
explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
memory being passed to the system allocator to free.

File:
1 edited

Legend:

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

    r47000 r47010  
    185185WTF_PRIVATE_INLINE void* operator new(size_t size, const std::nothrow_t&) throw() { return fastMalloc(size); }
    186186WTF_PRIVATE_INLINE void operator delete(void* p) { fastFree(p); }
     187WTF_PRIVATE_INLINE void operator delete(void* p, const std::nothrow_t&) throw() { fastFree(p); }
    187188WTF_PRIVATE_INLINE void* operator new[](size_t size) { return fastMalloc(size); }
    188189WTF_PRIVATE_INLINE void* operator new[](size_t size, const std::nothrow_t&) throw() { return fastMalloc(size); }
    189190WTF_PRIVATE_INLINE void operator delete[](void* p) { fastFree(p); }
     191WTF_PRIVATE_INLINE void operator delete[](void* p, const std::nothrow_t&) throw() { fastFree(p); }
    190192
    191193#endif
Note: See TracChangeset for help on using the changeset viewer.