From 033b46def884b94d3095f1f4fb71ca9cf0819081 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 16 Aug 2020 22:07:40 +0100 Subject: Add `mem.Allocator_Mode.Query_Features, `mem.Allocator_Mode_Set`, `mem.query_features` --- core/runtime/default_allocators.odin | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/runtime/default_allocators.odin') diff --git a/core/runtime/default_allocators.odin b/core/runtime/default_allocators.odin index 525bb3bc1..3643fccdf 100644 --- a/core/runtime/default_allocators.odin +++ b/core/runtime/default_allocators.odin @@ -132,6 +132,13 @@ default_temp_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode ptr := default_temp_allocator_proc(allocator_data, Allocator_Mode.Alloc, size, alignment, old_memory, old_size, flags, loc); mem_copy(ptr, old_memory, old_size); return ptr; + + case .Query_Features: + set := (^Allocator_Mode_Set)(old_memory); + if set != nil { + set^ = {.Alloc, .Free, .Free_All, .Resize, .Query_Features}; + } + return set; } return nil; -- cgit v1.2.3