Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: third_party/tcmalloc/win_allocator.cc

Issue 196041: Fix the windows allocator to behave properly on realloc.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/win_allocator.cc
===================================================================
--- third_party/tcmalloc/win_allocator.cc (revision 25582)
+++ third_party/tcmalloc/win_allocator.cc (working copy)
@@ -25,22 +25,26 @@
return true;
}
-void* win_heap_malloc(size_t s) {
- return HeapAlloc(win_heap, 0, s);
+void* win_heap_malloc(size_t size) {
+ return HeapAlloc(win_heap, 0, size);
}
-void* win_heap_realloc(void* p, size_t s) {
- if (!p)
- return win_heap_malloc(s);
- return HeapReAlloc(win_heap, 0, p, s);
+void win_heap_free(void* size) {
+ HeapFree(win_heap, 0, size);
}
-void win_heap_free(void* s) {
- HeapFree(win_heap, 0, s);
+void* win_heap_realloc(void* ptr, size_t size) {
+ if (!ptr)
+ return win_heap_malloc(size);
+ if (!size) {
+ win_heap_free(ptr);
+ return NULL;
+ }
+ return HeapReAlloc(win_heap, 0, ptr, size);
}
-size_t win_heap_msize(void* p) {
- return HeapSize(win_heap, 0, p);
+size_t win_heap_msize(void* ptr) {
+ return HeapSize(win_heap, 0, ptr);
}
} // extern "C"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698