aboutsummaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-08-16 22:07:40 +0100
committergingerBill <bill@gingerbill.org>2020-08-16 22:07:40 +0100
commit033b46def884b94d3095f1f4fb71ca9cf0819081 (patch)
tree13d510a3d499533524a2fd56681ca88a50a3a433 /core/os
parent1f571f48e5c3cf823f068e464324ff218314498f (diff)
Add `mem.Allocator_Mode.Query_Features, `mem.Allocator_Mode_Set`, `mem.query_features`
Diffstat (limited to 'core/os')
-rw-r--r--core/os/os.odin7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/os/os.odin b/core/os/os.odin
index c78b80417..9342355cf 100644
--- a/core/os/os.odin
+++ b/core/os/os.odin
@@ -194,6 +194,13 @@ heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
return aligned_alloc(size, alignment);
}
return aligned_resize(old_memory, old_size, size, alignment);
+
+ case .Query_Features:
+ set := (^mem.Allocator_Mode_Set)(old_memory);
+ if set != nil {
+ set^ = {.Alloc, .Free, .Resize, .Query_Features};
+ }
+ return set;
}
return nil;