Another bugfix for hashmap_chained

This commit is contained in:
2024-12-31 11:26:21 -05:00
parent 9015f4ce3c
commit c7d465d06e
12 changed files with 31 additions and 25 deletions

View File

@ -248,6 +248,7 @@ hmap_chained_set :: proc( self : HMapChained($Type), key : u64, value : Type ) -
block = slice_ptr(transmute([^]byte) raw_mem, slot_size)
// block, error = pool_grab(pool, false)
next := transmute( ^HMapChainedSlot(Type)) raw_data(block)
next^ = {}
slot.next = next
slot.next^ = {}
@ -257,7 +258,7 @@ hmap_chained_set :: proc( self : HMapChained($Type), key : u64, value : Type ) -
}
}
if ! slot.next.occupied || surface_slot.key == key
if ! slot.next.occupied || slot.next.key == key
{
slot.next.key = key
slot.next.value = value

View File

@ -50,7 +50,6 @@ logger_init :: proc( logger : ^ Logger, id : string, file_path : string, file :
LOGGER_VARENA_BASE_ADDRESS : uintptr = 2 * Terabyte
@static vmem_init_counter : uintptr = 0
when true {
alloc_error : AllocatorError
// logger.varena, alloc_error = varena_init(
// LOGGER_VARENA_BASE_ADDRESS + vmem_init_counter * 250 * Megabyte,
@ -64,9 +63,8 @@ logger_init :: proc( logger : ^ Logger, id : string, file_path : string, file :
vmem_init_counter += 1
// TODO(Ed): Figure out another solution here...
// logger.entries, alloc_error = array_init(Array(LoggerEntry), 8192, runtime.heap_allocator())
// verify( alloc_error == .None, "Failed to allocate logger's entries array")
}
logger.entries, alloc_error = array_init(Array(LoggerEntry), 8192, runtime.heap_allocator())
verify( alloc_error == .None, "Failed to allocate logger's entries array")
context.logger = { logger_interface, logger, core_log.Level.Debug, core_log.Default_File_Logger_Opts }
log("Initialized Logger")

View File

@ -338,7 +338,7 @@ pool_validate :: proc( pool : Pool )
pool_validate_ownership :: proc( using self : Pool, block : [] byte ) -> b32
{
profile(#procedure)
// profile(#procedure)
within_bucket := b32(false)
// Compiler Bug : Same as pool_reset