| 201 | } |
| 202 | |
| 203 | CallTrace* CallTraceStorage::storeCallTrace(int num_frames, ASGCT_CallFrame* frames) { |
| 204 | const size_t header_size = sizeof(CallTrace) - sizeof(ASGCT_CallFrame); |
| 205 | CallTrace* buf = (CallTrace*)_allocator.alloc(header_size + num_frames * sizeof(ASGCT_CallFrame)); |
| 206 | if (buf != NULL) { |
| 207 | buf->num_frames = num_frames; |
| 208 | // Do not use memcpy inside signal handler |
| 209 | for (int i = 0; i < num_frames; i++) { |
| 210 | buf->frames[i] = frames[i]; |
| 211 | } |
| 212 | } |
| 213 | return buf; |
| 214 | } |
| 215 | |
| 216 | CallTrace* CallTraceStorage::findCallTrace(LongHashTable* table, u64 hash) { |
| 217 | u64* keys = table->keys(); |