aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorColin Davidson <colrdavidson@gmail.com>2023-12-04 03:09:13 -0800
committerColin Davidson <colrdavidson@gmail.com>2023-12-04 03:09:13 -0800
commitbfbeb23f5479af375ceea6d97d2add64a6bc6519 (patch)
tree8f6e945eea01111bd783bc626280a2672700c0e4 /core
parent58e4a011c72d268ca35d46d2288d5858677e9cac (diff)
add resize non zeroed in more places
Diffstat (limited to 'core')
-rw-r--r--core/log/log_allocator.odin9
-rw-r--r--core/mem/virtual/arena.odin2
-rw-r--r--core/runtime/default_allocators_windows.odin4
3 files changed, 11 insertions, 4 deletions
diff --git a/core/log/log_allocator.odin b/core/log/log_allocator.odin
index 934f0d643..846a84a62 100644
--- a/core/log/log_allocator.odin
+++ b/core/log/log_allocator.odin
@@ -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
-} \ No newline at end of file
+}
diff --git a/core/mem/virtual/arena.odin b/core/mem/virtual/arena.odin
index d15df46ad..f6fbe237f 100644
--- a/core/mem/virtual/arena.odin
+++ b/core/mem/virtual/arena.odin
@@ -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 {
diff --git a/core/runtime/default_allocators_windows.odin b/core/runtime/default_allocators_windows.odin
index a78a4d04e..1b0f78428 100644
--- a/core/runtime/default_allocators_windows.odin
+++ b/core/runtime/default_allocators_windows.odin
@@ -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,
}
}
-} \ No newline at end of file
+}