static void exit_event(void) { #ifdef SHOW_RESULTS char msg[512]; int len; len = dr_snprintf(msg, sizeof(msg)/sizeof(msg[0]), "Instrumentation results:\n" "Processed %d instructions\n" ,fp_count); DR_ASSERT(len > 0); NULL_TERMINATE(msg); DISPLAY_STRING(msg); #endif /* SHOW_RESULTS */ dr_mutex_destroy(count_mutex); #ifdef SHOW_SYMBOLS if (drsym_exit() != DRSYM_SUCCESS) { dr_log(NULL, LOG_ALL, 1, "WARNING: error cleaning up symbol library\n"); } #endif printht(); __wrap_free(testarr); }
void *__wrap_realloc(void *p, size_t size) { void *new_ptr = __wrap_malloc(size); if (p != 0 && new_ptr != 0) { memcpy(new_ptr, p, __wrap_malloc_usable_size(p) < size ? __wrap_malloc_usable_size(p) : size); __wrap_free(p); } return new_ptr; }
void * __wrap_realloc(void *ptr, size_t size) { if (!ptr) { return __wrap_malloc(size); } if (__wrap_malloc_usable_size(ptr) >= size) { return ptr; } void *realloc_ptr = __wrap_malloc(size); if(!realloc_ptr) { return NULL; } memcpy(realloc_ptr, ptr, __wrap_malloc_usable_size(ptr)); __wrap_free(ptr); return realloc_ptr; }
void MEM2_free(void *ptr) { __wrap_free(ptr); }
void __wrap__free_r(struct _reent *r, void *ptr) { return __wrap_free(ptr); }
void __wrap__free_r(struct _reent *r, void *p) { __wrap_free(p); }