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

Unified Diff: third_party/lzma_sdk/Alloc.c

Issue 10152012: Second attempt to update lzma_sdk to 9.20 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 | « third_party/lzma_sdk/Alloc.h ('k') | third_party/lzma_sdk/Archive/7z/7zAlloc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/lzma_sdk/Alloc.c
diff --git a/third_party/lzma_sdk/Alloc.c b/third_party/lzma_sdk/Alloc.c
index 7b5af4200b233921ab85009ae7b37ac275fbea1b..358a7b52650ebf46fb40a984e0e9a129864d77d0 100644
--- a/third_party/lzma_sdk/Alloc.c
+++ b/third_party/lzma_sdk/Alloc.c
@@ -1,4 +1,7 @@
-/* Alloc.c */
+/* Alloc.c -- Memory allocation functions
+2008-09-24
+Igor Pavlov
+Public domain */
#ifdef _WIN32
#include <windows.h>
@@ -22,16 +25,21 @@ void *MyAlloc(size_t size)
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc %10d bytes; count = %10d", size, g_allocCount++);
- #endif
+ {
+ void *p = malloc(size);
+ fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
+ return p;
+ }
+ #else
return malloc(size);
+ #endif
}
void MyFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
- fprintf(stderr, "\nFree; count = %10d", --g_allocCount);
+ fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
#endif
free(address);
}
@@ -95,7 +103,7 @@ void *BigAlloc(size_t size)
#ifdef _7ZIP_LARGE_PAGES
if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
{
- void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
+ void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
if (res != 0)
return res;
« no previous file with comments | « third_party/lzma_sdk/Alloc.h ('k') | third_party/lzma_sdk/Archive/7z/7zAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698