Lines Matching defs:entry

81     HashEntry* entry;
111 HashEntry* entry = table->slots[slot];
112 while (entry != NULL) {
113 //debug_log("backtrace: %p, entry: %p entry->backtrace: %p\n",
114 // backtrace, entry, (entry != NULL) ? entry->backtrace : NULL);
116 * See if the entry matches exactly. We compare the "size" field,
119 if (entry->size == size && entry->numEntries == numEntries &&
120 !memcmp(backtrace, entry->backtrace, numEntries * sizeof(uintptr_t))) {
121 return entry;
124 entry = entry->next;
143 HashEntry* entry = find_entry(g_hash_table, slot, backtrace, numEntries, size);
145 if (entry != NULL) {
146 entry->allocations++;
148 // create a new entry
149 entry = static_cast<HashEntry*>(g_malloc_dispatch->malloc(sizeof(HashEntry) + numEntries*sizeof(uintptr_t)));
150 if (!entry) {
153 entry->allocations = 1;
154 entry->slot = slot;
155 entry->prev = NULL;
156 entry->next = g_hash_table->slots[slot];
157 entry->numEntries = numEntries;
158 entry->size = size;
160 memcpy(entry->backtrace, backtrace, numEntries * sizeof(uintptr_t));
162 g_hash_table->slots[slot] = entry;
164 if (entry->next != NULL) {
165 entry->next->prev = entry;
168 // we just added an entry, increase the size of the hashtable
172 return entry;
175 static int is_valid_entry(HashEntry* entry) {
176 if (entry != NULL) {
180 if (e1 == entry) {
190 static void remove_entry(HashEntry* entry) {
191 HashEntry* prev = entry->prev;
192 HashEntry* next = entry->next;
194 if (prev != NULL) entry->prev->next = next;
195 if (next != NULL) entry->next->prev = prev;
199 g_hash_table->slots[entry->slot] = entry->next;
202 // we just removed and entry, decrease the size of the hashtable
318 header->entry = record_backtrace(backtrace, numEntries, bytes);
346 // For memaligned blocks, header->entry points to the memory
348 header = to_header(header->entry);
352 if (header->guard == GUARD || is_valid_entry(header->entry)) {
354 HashEntry* entry = header->entry;
355 entry->allocations--;
356 if (entry->allocations <= 0) {
357 remove_entry(entry);
358 g_malloc_dispatch->free(entry);
364 debug_log("WARNING bad header guard: '0x%x'! and invalid entry: %p\n",
365 header->guard, header->entry);
402 // entry.
403 header = const_to_header(header->entry);
405 debug_log("WARNING bad header guard: '0x%x'! and invalid entry: %p\n",
406 header->guard, header->entry);
431 header = to_header(header->entry);
433 debug_log("WARNING bad header guard: '0x%x'! and invalid entry: %p\n",
434 header->guard, header->entry);
488 header->entry = reinterpret_cast<HashEntry*>(base);