Andrew Savchenko

Hide paranoid stuff under PARANOID ifdef

buffer increments for allocator should be done only in PARANOID
mode.
Showing 1 changed file with 6 additions and 1 deletions
... ... @@ -22,7 +22,9 @@
#include "output.h"
void *xmalloc(size_t size) {
#ifdef PARANOID
size++; // Just in case
#endif
void *ret = malloc(size);
... ... @@ -38,8 +40,10 @@ void *xmalloc(size_t size) {
}
void *xcalloc(size_t nmemb, size_t size) {
#ifdef PARANOID
nmemb++; // Just in case
size++; // Just in case
#endif
void *ret = calloc(nmemb, size);
... ... @@ -53,7 +57,9 @@ void *xcalloc(size_t nmemb, size_t size) {
}
void *xrealloc(void *oldptr, size_t size) {
#ifdef PARANOID
size++; // Just in case
#endif
void *ret = realloc(oldptr, size);
... ... @@ -64,4 +70,3 @@ void *xrealloc(void *oldptr, size_t size) {
return ret;
}
... ...