Changeset 47010 in webkit for trunk/JavaScriptCore


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.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r47003 r47010  
     12009-08-10  Mark Rowe  <[email protected]>
     2       
     3        Reviewed by Darin Adler.
     4
     5        Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.
     6
     7        * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since
     8        we implement the nothrow variants of new and new[].  The nothrow variant of delete is called
     9        explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
     10        memory being passed to the system allocator to free.
     11
    1122009-08-10  Jan Michael Alonzo  <[email protected]>
    213
  • 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.