Skip to content

Commit

Permalink
Added alignment output to CustomAllocator example
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbinks committed Aug 21, 2020
1 parent be946f9 commit 2980213
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions example/CustomAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ void* CustomAllocFunc( size_t align_, size_t size_, void* userData_, const char*
// We don't need to use this macro as file_ and line_ will be valid and printable just not useful
// But for this example it makes prettier output :)
#ifdef ENKI_CUSTOM_ALLOC_FILE_AND_LINE
printf("Allocating %g bytes in domain %s, total %g. File %s, line %d.\n",
(double)size_, data->domainName, (double)data->totalAllocations, file_, line_ );
printf("Allocating %g bytes with alignment %g in domain %s, total %g. File %s, line %d.\n",
(double)size_, (double)align_, data->domainName, (double)data->totalAllocations, file_, line_ );
#else
(void)file_; (void)line_;
printf("Allocating %g bytes in domain %s, total %g.\n",
(double)size_, data->domainName, (double)data->totalAllocations );
printf("Allocating %g bytes with alignment %g in domain %s, total %g.\n",
(double)size_, (double)align_, data->domainName, (double)data->totalAllocations );
#endif

return DefaultAllocFunc( align_, size_, userData_, file_, line_ );
Expand Down

0 comments on commit 2980213

Please sign in to comment.