floooh / sokol-zig

Zig bindings for the sokol headers (https://github.com/floooh/sokol)
zlib License
372 stars 49 forks source link

Feature request: generate `inline` for simple wrapper functions #2

Closed pixelherodev closed 3 years ago

pixelherodev commented 4 years ago

A lot of generated functions are merely small wrappers around C functions, e.g.:

pub fn makeImage(desc: ImageDesc) Image {
    return sg_make_image(&desc);
}

These will almost certainly be inlined by the compiler, but generating them as pub inline fn would ensure it (and, presumably, mean less work on the compiler for optimization, since it doesn't have to check whether to do optimization).