diff options
| author | gingerBill <bill@gingerbill.org> | 2024-03-13 16:30:28 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-03-13 16:30:28 +0000 |
| commit | 97d6bf6d8f0f6e0815570cb1c798f35dc77cec47 (patch) | |
| tree | 24b67ec3bc9434ef1fb19b9c367813f1d6d16dea | |
| parent | 271f84ab5b7cfbed6ec93d513fa5ad8cc2b211c8 (diff) | |
| parent | 75b60fdb1295d46def76bca9903a8f1e0fcb4e08 (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
| -rw-r--r-- | core/mem/mutex_allocator.odin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/mem/mutex_allocator.odin b/core/mem/mutex_allocator.odin index bf69c9b81..591703eab 100644 --- a/core/mem/mutex_allocator.odin +++ b/core/mem/mutex_allocator.odin @@ -3,19 +3,19 @@ package mem import "core:sync" -Mutex_allocator :: struct { +Mutex_Allocator :: struct { backing: Allocator, mutex: sync.Mutex, } -mutex_allocator_init :: proc(m: ^Mutex_allocator, backing_allocator: Allocator) { +mutex_allocator_init :: proc(m: ^Mutex_Allocator, backing_allocator: Allocator) { m.backing = backing_allocator m.mutex = {} } @(require_results) -mutex_allocator :: proc(m: ^Mutex_allocator) -> Allocator { +mutex_allocator :: proc(m: ^Mutex_Allocator) -> Allocator { return Allocator{ procedure = mutex_allocator_proc, data = m, @@ -25,7 +25,7 @@ mutex_allocator :: proc(m: ^Mutex_allocator) -> Allocator { mutex_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, size, alignment: int, old_memory: rawptr, old_size: int, loc := #caller_location) -> (result: []byte, err: Allocator_Error) { - m := (^Mutex_allocator)(allocator_data) + m := (^Mutex_Allocator)(allocator_data) sync.mutex_guard(&m.mutex) return m.backing.procedure(m.backing.data, mode, size, alignment, old_memory, old_size, loc) |