mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
Allocator_Error.Mode_Not_Implemented; Minor improvement to map runtime procedures
This commit is contained in:
@@ -276,10 +276,11 @@ Allocator_Query_Info :: struct {
|
||||
}
|
||||
|
||||
Allocator_Error :: enum byte {
|
||||
None = 0,
|
||||
Out_Of_Memory = 1,
|
||||
Invalid_Pointer = 2,
|
||||
Invalid_Argument = 3,
|
||||
None = 0,
|
||||
Out_Of_Memory = 1,
|
||||
Invalid_Pointer = 2,
|
||||
Invalid_Argument = 3,
|
||||
Mode_Not_Implemented = 4,
|
||||
}
|
||||
|
||||
Allocator_Proc :: #type proc(allocator_data: rawptr, mode: Allocator_Mode,
|
||||
|
||||
@@ -196,6 +196,7 @@ __dynamic_map_rehash :: proc(using header: Map_Header, new_count: int, loc := #c
|
||||
new_header: Map_Header = header;
|
||||
nm := Raw_Map{};
|
||||
nm.entries.allocator = m.entries.allocator;
|
||||
nm.hashes = m.hashes;
|
||||
new_header.m = &nm;
|
||||
|
||||
c := context;
|
||||
@@ -239,7 +240,6 @@ __dynamic_map_rehash :: proc(using header: Map_Header, new_count: int, loc := #c
|
||||
}
|
||||
}
|
||||
|
||||
delete(m.hashes, m.entries.allocator, loc);
|
||||
free(m.entries.data, m.entries.allocator, loc);
|
||||
header.m^ = nm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user