Skip to content

slim down glow #23

@bryanturley

Description

@bryanturley

My original cgo bindings took 4 minutes to compile with go (WITH GO).
That was on tip between 1.1 and 1.2.
4 minutes! go compile times really spoiled me so I had to fix this ;)
I did a bunch of things to make the source smaller that should also help glow.
Especially since the core 4.4 package compiles into a 13MB .a file.

https://github.com/bryanturley/old_gl/blob/master/core/funcs.go#L1178
Scroll to the very end of that line. You will see // 14
That means those 14 opengl functions share that function signature.
Which in turn means you can turn 14 bridges into 1.
The only downside to that is you get semi-ugly looking unnamed bridge functions.
In this example the type bgl003_t is only used with the function bgl003 (3 hex digits)
https://github.com/bryanturley/old_gl/blob/master/core/funcs.go#L326
The go side of those 14 functions all call bgl003 with their own function pointer (of type bgl003_t), since they all share the same function signature.
https://github.com/bryanturley/old_gl/blob/master/core/funcs.go#L4860 <-- one of the bgl003

I think this shrunk my source files 40-60% and should make a significant impact on your library size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions