mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-20 16:36:46 +00:00
Removed implicit assignments for container allocators in the Base and Core packages
This commit is contained in:
@@ -692,6 +692,8 @@ _unmarshal_map :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header,
|
||||
case reflect.Type_Info_Map:
|
||||
raw_map := (^mem.Raw_Map)(v.data)
|
||||
if raw_map.allocator.procedure == nil {
|
||||
// Note(Ed) - Sectr Fork: I'm premmtively leaving this here incase it happens...
|
||||
runtime.debug_trap()
|
||||
raw_map.allocator = context.allocator
|
||||
}
|
||||
|
||||
|
||||
@@ -526,6 +526,8 @@ unmarshal_object :: proc(p: ^Parser, v: any, end_token: Token_Kind) -> (err: Unm
|
||||
}
|
||||
raw_map := (^mem.Raw_Map)(v.data)
|
||||
if raw_map.allocator.procedure == nil {
|
||||
// Note(Ed) - Sectr Fork: I'm premmtively leaving this here incase it happens...
|
||||
runtime.debug_trap()
|
||||
raw_map.allocator = p.allocator
|
||||
}
|
||||
|
||||
|
||||
@@ -203,9 +203,14 @@ set_key_value :: proc(model: ^$T, parser: ^Parser, name, key, value: string) ->
|
||||
elem_backing: []byte
|
||||
value_ptr: rawptr
|
||||
|
||||
if raw_map.allocator.procedure == nil {
|
||||
raw_map.allocator = context.allocator
|
||||
} else {
|
||||
|
||||
assert(raw_map.allocator.procedure != nil)
|
||||
// Note(Ed) - Sectr Fork: Not a fan. (I want it to assert)
|
||||
// if raw_map.allocator.procedure == nil {
|
||||
// raw_map.allocator = context.allocator
|
||||
// }
|
||||
// else
|
||||
{
|
||||
value_ptr = runtime.__dynamic_map_get(raw_map,
|
||||
specific_type_info.map_info,
|
||||
hash,
|
||||
|
||||
@@ -232,9 +232,11 @@ tracking_allocator_proc :: proc(
|
||||
}
|
||||
result_ptr := raw_data(result)
|
||||
|
||||
if data.allocation_map.allocator.procedure == nil {
|
||||
data.allocation_map.allocator = context.allocator
|
||||
}
|
||||
// Note(Ed) - Sectr Fork: Not a fan. (I want it to assert)
|
||||
// if data.allocation_map.allocator.procedure == nil {
|
||||
// data.allocation_map.allocator = context.allocator
|
||||
// }
|
||||
assert(data.allocation_map.allocator.procedure != nil)
|
||||
|
||||
switch mode {
|
||||
case .Alloc, .Alloc_Non_Zeroed:
|
||||
|
||||
@@ -105,9 +105,10 @@ Returns:
|
||||
- err: An allocator error if one occured, `nil` otherwise
|
||||
*/
|
||||
_intern_get_entry :: proc(m: ^Intern, text: string) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error) #no_bounds_check {
|
||||
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
|
||||
// }
|
||||
|
||||
key_ptr, val_ptr, inserted := map_entry(&m.entries, text) or_return
|
||||
if !inserted {
|
||||
|
||||
Reference in New Issue
Block a user