Skip to content

Commit

Permalink
Fixed Allocator function argument type in helpers.
Browse files Browse the repository at this point in the history
This corresponds to a change in the bindgen mappings, see
floooh/sokol#1157 and floooh/sokol#1158, except this function is not
automatically generated.
  • Loading branch information
Barinzaya committed Nov 19, 2024
1 parent 27d3073 commit ffe3690
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sokol/helpers/allocator.odin
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package sokol_helpers
import sapp "../app"
import sg "../gfx"
import "base:runtime"
import "core:c"

Allocator :: struct {
alloc_fn: proc "c" (size: u64, user_data: rawptr) -> rawptr,
alloc_fn: proc "c" (size: c.size_t, user_data: rawptr) -> rawptr,
free_fn: proc "c" (ptr: rawptr, user_data: rawptr),
user_data: rawptr,
}
Expand All @@ -22,7 +23,7 @@ allocator :: proc(context_ptr: ^runtime.Context) -> Allocator {
}
}

allocator_alloc_proc :: proc "c" (size: u64, user_data: rawptr) -> rawptr {
allocator_alloc_proc :: proc "c" (size: c.size_t, user_data: rawptr) -> rawptr {
context = (cast(^runtime.Context)user_data)^
bytes, err := runtime.mem_alloc(size = int(size))
if err != nil {
Expand Down

0 comments on commit ffe3690

Please sign in to comment.