mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
docs: add note about checking for alloc error
This commit is contained in:
@@ -265,6 +265,8 @@ parse_object_body :: proc(p: ^Parser, end_token: Token_Kind) -> (obj: Object, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
insert_success := runtime.map_insert(&obj, key, elem)
|
insert_success := runtime.map_insert(&obj, key, elem)
|
||||||
|
// NOTE(gonz): we'd rather check specifically for an allocation error here but
|
||||||
|
// `map_insert` doesn't differentiate; we can only check for `nil`
|
||||||
if insert_success == nil {
|
if insert_success == nil {
|
||||||
return nil, .Out_Of_Memory
|
return nil, .Out_Of_Memory
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user