Removed implicit assignments for container allocators in the Base and Core packages

This commit is contained in:
ed
2025-01-12 21:41:15 -05:00
parent 37ec315a91
commit 5a7b8b463b
11 changed files with 77 additions and 40 deletions
+10 -6
View File
@@ -587,9 +587,11 @@ map_reserve_dynamic :: #force_no_inline proc "odin" (#no_alias m: ^Raw_Map, #no_
return size_of(uintptr)*8 - 1 - z
}
if m.allocator.procedure == nil {
m.allocator = context.allocator
}
// Note(Ed) - Sectr Fork: Not a fan. (I want it to assert)
// if m.allocator.procedure == nil {
// m.allocator = context.allocator
// }
assert( m.allocator.procedure != nil)
new_capacity := new_capacity
old_capacity := uintptr(map_cap(m^))
@@ -642,9 +644,11 @@ map_reserve_dynamic :: #force_no_inline proc "odin" (#no_alias m: ^Raw_Map, #no_
@(require_results)
map_shrink_dynamic :: #force_no_inline proc "odin" (#no_alias m: ^Raw_Map, #no_alias info: ^Map_Info, loc := #caller_location) -> (did_shrink: bool, err: Allocator_Error) {
if m.allocator.procedure == nil {
m.allocator = context.allocator
}
// Note(Ed) - Sectr Fork: Not a fan. (I want it to assert)
// if m.allocator.procedure == nil {
// m.allocator = context.allocator
// }
assert( m.allocator.procedure != nil)
// Cannot shrink the capacity if the number of items in the map would exceed
// one minus the current log2 capacity's resize threshold. That is the shrunk