Lines Matching refs:ptr
60 void* ptr = trace_data->ptrs[i]; in FreePtrs() local
61 if (ptr != nullptr) { in FreePtrs()
62 free(ptr); in FreePtrs()
108 ptr_to_index[entry->ptr] = idx; in GetTraceData()
109 entry->ptr = idx; in GetTraceData()
124 ptr_to_index[entry->ptr] = idx; in GetTraceData()
125 entry->ptr = idx; in GetTraceData()
129 if (entry->ptr != 0) { in GetTraceData()
130 auto idx_entry = ptr_to_index.find(entry->ptr); in GetTraceData()
132 errx(1, "File Error: Unable to find free pointer %" PRIx64, entry->ptr); in GetTraceData()
135 entry->ptr = idx_entry->second + 1; in GetTraceData()
158 void* ptr; in RunTrace() local
163 ptr = malloc(entry.size); in RunTrace()
164 if (ptr == nullptr) { in RunTrace()
167 MakeAllocationResident(ptr, entry.size, pagesize); in RunTrace()
170 if (ptrs[entry.ptr] != nullptr) { in RunTrace()
173 ptrs[entry.ptr] = ptr; in RunTrace()
178 ptr = calloc(entry.u.n_elements, entry.size); in RunTrace()
179 if (ptr == nullptr) { in RunTrace()
182 MakeAllocationResident(ptr, entry.size, pagesize); in RunTrace()
185 if (ptrs[entry.ptr] != nullptr) { in RunTrace()
188 ptrs[entry.ptr] = ptr; in RunTrace()
193 ptr = memalign(entry.u.align, entry.size); in RunTrace()
194 if (ptr == nullptr) { in RunTrace()
197 MakeAllocationResident(ptr, entry.size, pagesize); in RunTrace()
200 if (ptrs[entry.ptr] != nullptr) { in RunTrace()
203 ptrs[entry.ptr] = ptr; in RunTrace()
209 ptr = realloc(nullptr, entry.size); in RunTrace()
211 ptr = realloc(ptrs[entry.u.old_ptr - 1], entry.size); in RunTrace()
215 if (ptr == nullptr) { in RunTrace()
218 MakeAllocationResident(ptr, entry.size, pagesize); in RunTrace()
222 if (ptrs[entry.ptr] != nullptr) { in RunTrace()
225 ptrs[entry.ptr] = ptr; in RunTrace()
229 if (entry.ptr != 0) { in RunTrace()
230 ptr = ptrs[entry.ptr - 1]; in RunTrace()
231 ptrs[entry.ptr - 1] = nullptr; in RunTrace()
233 ptr = nullptr; in RunTrace()
236 free(ptr); in RunTrace()