Lines Matching refs:entry

102     AllocEntry* entry = &trace_data->entries[i];  in GetTraceData()  local
103 switch (entry->type) { in GetTraceData()
108 ptr_to_index[entry->ptr] = idx; in GetTraceData()
109 entry->ptr = idx; in GetTraceData()
113 if (entry->u.old_ptr != 0) { in GetTraceData()
114 auto idx_entry = ptr_to_index.find(entry->u.old_ptr); in GetTraceData()
116 errx(1, "File Error: Failed to find realloc pointer %" PRIx64, entry->u.old_ptr); in GetTraceData()
121 entry->u.old_ptr = old_pointer_idx + 1; 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()
159 const AllocEntry& entry = trace_data->entries[i]; in RunTrace() local
160 switch (entry.type) { in RunTrace()
163 ptr = malloc(entry.size); 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()
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()
197 MakeAllocationResident(ptr, entry.size, pagesize); in RunTrace()
200 if (ptrs[entry.ptr] != nullptr) { in RunTrace()
203 ptrs[entry.ptr] = ptr; in RunTrace()
208 if (entry.u.old_ptr == 0) { in RunTrace()
209 ptr = realloc(nullptr, entry.size); in RunTrace()
211 ptr = realloc(ptrs[entry.u.old_ptr - 1], entry.size); in RunTrace()
212 ptrs[entry.u.old_ptr - 1] = nullptr; in RunTrace()
214 if (entry.size > 0) { 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()