Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tau/tau.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,13 @@ static void tauClockPrintDuration(const double nanoseconds_duration) {

static inline void* tau_realloc(void* const ptr, const tau_ull new_size) {
void* const new_ptr = realloc(ptr, new_size);

if(TAU_NONE(new_ptr))
free(new_ptr);


if(TAU_NONE(new_ptr) && new_size > 0) {
fprintf(stderr, "FATAL: tau_realloc failed to allocate %" TAU_PRIu64 " bytes\n",
(tau_u64)new_size);
TAU_ABORT;
}

return new_ptr;
}
#endif // TAU_NO_TESTING
Expand Down
Loading