diff options
Diffstat (limited to 'src/util/common_allocation.c')
-rw-r--r-- | src/util/common_allocation.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 1e546b962..5be7caaa7 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -32,11 +32,11 @@ | |||
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #if 0 | 34 | #if 0 |
35 | #define W32_MEM_LIMIT 200000000 | 35 | #define W32_MEM_LIMIT 200000000 |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #ifdef W32_MEM_LIMIT | 38 | #ifdef W32_MEM_LIMIT |
39 | static LONG mem_used = 0; | 39 | static LONG mem_used = 0; |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | /** | 42 | /** |
@@ -66,7 +66,7 @@ GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber) | |||
66 | void *result; | 66 | void *result; |
67 | 67 | ||
68 | #ifdef W32_MEM_LIMIT | 68 | #ifdef W32_MEM_LIMIT |
69 | size += sizeof(size_t); | 69 | size += sizeof (size_t); |
70 | if (mem_used + size > W32_MEM_LIMIT) | 70 | if (mem_used + size > W32_MEM_LIMIT) |
71 | return NULL; | 71 | return NULL; |
72 | #endif | 72 | #endif |
@@ -109,7 +109,7 @@ GNUNET_xrealloc_ (void *ptr, | |||
109 | const char *filename, int linenumber) | 109 | const char *filename, int linenumber) |
110 | { | 110 | { |
111 | #ifdef W32_MEM_LIMIT | 111 | #ifdef W32_MEM_LIMIT |
112 | n += sizeof(size_t); | 112 | n += sizeof (size_t); |
113 | ptr = &((size_t *) ptr)[-1]; | 113 | ptr = &((size_t *) ptr)[-1]; |
114 | mem_used = mem_used - *((size_t *) ptr) + n; | 114 | mem_used = mem_used - *((size_t *) ptr) + n; |
115 | #endif | 115 | #endif |