In tests, don’t record allocations while printing debug graphs

This commit is contained in:
Max Brunsfeld 2016-05-16 10:44:19 -07:00
parent d50f6a58cc
commit 88053cf723
4 changed files with 60 additions and 21 deletions

View file

@ -11,6 +11,7 @@ void *ts_record_malloc(size_t);
void *ts_record_calloc(size_t, size_t);
void *ts_record_realloc(void *, size_t);
void ts_record_free(void *);
bool ts_record_allocations_toggle(bool);
static inline void *ts_malloc(size_t size) {
return ts_record_malloc(size);
@ -28,10 +29,18 @@ static inline void ts_free(void *buffer) {
return ts_record_free(buffer);
}
static inline bool ts_toggle_allocation_recording(bool value) {
return ts_record_allocations_toggle(value);
}
#else
#include <stdlib.h>
static inline bool ts_toggle_allocation_recording(bool value) {
return false;
}
static inline void *ts_malloc(size_t size) {
return malloc(size);
}