add resize non zeroed in more places

This commit is contained in:
Colin Davidson
2023-12-04 03:09:13 -08:00
parent 58e4a011c7
commit bfbeb23f54
5 changed files with 14 additions and 7 deletions
+8 -1
View File
@@ -80,6 +80,13 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
la.prefix, padding, old_memory, old_size, size, alignment,
location = location,
)
case .Resize_Non_Zeroed:
logf(
la.level,
"%s%s>>> ALLOCATOR(mode=.Resize_Non_Zeroed, ptr=%p, old_size=%d, size=%d, alignment=%d)",
la.prefix, padding, old_memory, old_size, size, alignment,
location = location,
)
case .Query_Features:
logf(
la.level,
@@ -111,4 +118,4 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
}
}
return data, err
}
}
+1 -1
View File
@@ -288,7 +288,7 @@ arena_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
err = .Mode_Not_Implemented
case .Free_All:
arena_free_all(arena, location)
case .Resize:
case .Resize, .Resize_Non_Zeroed:
old_data := ([^]byte)(old_memory)
switch {
+2 -2
View File
@@ -19,7 +19,7 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
case .Free_All:
return nil, .Mode_Not_Implemented
case .Resize:
case .Resize, .Resize_Non_Zeroed:
data, err = _windows_default_resize(old_memory, old_size, size, alignment)
case .Query_Features:
@@ -41,4 +41,4 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
data = nil,
}
}
}
}