RESOLVED FIXED 167800
malloc and posix_memalign used without including cstdlib
https://bugs.webkit.org/show_bug.cgi?id=167800
Summary malloc and posix_memalign used without including cstdlib
Ting-Wei Lan
Reported 2017-02-03 10:15:59 PST
This causes compilation error on FreeBSD: /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:78:20: error: no member named 'malloc' in the global namespace; did you mean simply 'malloc'? void* result = ::malloc(size); ^~~~~~~~ malloc /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:76:18: note: 'malloc' declared here void* DebugHeap::malloc(size_t size) ^ /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:87:9: error: use of undeclared identifier 'posix_memalign' if (posix_memalign(&result, alignment, size)) { ^ /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:97:20: error: no member named 'realloc' in the global namespace; did you mean simply 'realloc'? void* result = ::realloc(object, size); ^~~~~~~~~ realloc /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:95:18: note: 'realloc' declared here void* DebugHeap::realloc(void* object, size_t size) ^ /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:105:7: error: no type named 'free' in the global namespace ::free(object); ~~^ /path/to/WebKit/Source/bmalloc/bmalloc/DebugHeap.cpp:103:28: warning: unused parameter 'object' [-Wunused-parameter] void DebugHeap::free(void* object) ^ 1 warning and 4 errors generated.
Attachments
mmm (1.04 KB, patch)
2017-02-03 10:18 PST, Ting-Wei Lan
no flags
Patch (1.04 KB, patch)
2017-02-03 10:19 PST, Ting-Wei Lan
no flags
Ting-Wei Lan
Comment 1 2017-02-03 10:18:34 PST
Ting-Wei Lan
Comment 2 2017-02-03 10:19:25 PST
Geoffrey Garen
Comment 3 2017-02-03 13:48:39 PST
Comment on attachment 300544 [details] Patch r=me
WebKit Commit Bot
Comment 4 2017-02-03 14:00:35 PST
Comment on attachment 300544 [details] Patch Clearing flags on attachment: 300544 Committed r211651: <http://trac.webkit.org/changeset/211651>
WebKit Commit Bot
Comment 5 2017-02-03 14:00:39 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.