fix (hashmaps): fixed bug that caused PFs and GPFs while handling collisions
This commit is contained in:
parent
8c273f4dc7
commit
ae0ef5c85d
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
"PS2_ACPI_VALIDATION": true,
|
||||
"LOG_GRAPHICAL": false,
|
||||
"LOG_GRAPHICAL": true,
|
||||
|
||||
"drivers": [
|
||||
"/initrd/drv/test.nxkm",
|
||||
"/initrd/drv/nx_std_fat32.nxkm"
|
||||
],
|
||||
"test": 1
|
||||
]
|
||||
}
|
|
@ -37,10 +37,13 @@ void hashmap_insert(hashmap_T* hashmap, uint64_t key, void* value) {
|
|||
}
|
||||
|
||||
hashmap_entry_T* entry = &hashmap->entries[index];
|
||||
while (entry->next != NULL) entry = entry->next;
|
||||
while (entry->next != NULL) {
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
entry->next = memory_allocate(sizeof(hashmap_entry_T));
|
||||
entry->next->prev = entry;
|
||||
entry->next->next = NULL;
|
||||
entry->next->key = key;
|
||||
entry->next->value = value;
|
||||
entry->next->in_use = true;
|
||||
|
|
Loading…
Reference in New Issue