File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ __attribute__((visibility("default"))) void fil_dump_peak_to_flamegraph(const ch
101
101
// Override memory-allocation functions:
102
102
__attribute__((visibility ("default" ))) void * malloc (size_t size ) {
103
103
void * result = __libc_malloc (size );
104
- if (size > 1000 && result != NULL && !will_i_be_reentrant && initialized ) {
104
+ if (!will_i_be_reentrant && initialized ) {
105
105
will_i_be_reentrant = 1 ;
106
106
add_allocation_hook ((size_t )result , size );
107
107
will_i_be_reentrant = 0 ;
@@ -112,7 +112,7 @@ __attribute__((visibility("default"))) void *malloc(size_t size) {
112
112
__attribute__((visibility ("default" ))) void * calloc (size_t nmemb , size_t size ) {
113
113
void * result = __libc_calloc (nmemb , size );
114
114
size_t allocated = nmemb * size ;
115
- if (allocated > 1000 && !will_i_be_reentrant && initialized ) {
115
+ if (!will_i_be_reentrant && initialized ) {
116
116
will_i_be_reentrant = 1 ;
117
117
add_allocation_hook ((size_t )result , allocated );
118
118
will_i_be_reentrant = 0 ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ impl AllocationTracker {
64
64
let alloc = Allocation { callstack, size } ;
65
65
self . current_allocations . insert ( address, alloc) ;
66
66
self . current_allocated_bytes += size;
67
- if self . current_allocated_bytes > self . peak_allocated_bytes {
67
+ if self . current_allocated_bytes > self . peak_allocated_bytes + 10000 {
68
68
self . peak_allocated_bytes = self . current_allocated_bytes ;
69
69
self . peak_allocations = self . current_allocations . clone ( ) ;
70
70
}
You can’t perform that action at this time.
0 commit comments