gotk4 icon indicating copy to clipboard operation
gotk4 copied to clipboard

Override C function headers with untyped variant

Open diamondburned opened this issue 3 years ago • 0 comments

I've thought of a way that can potentially improve compile time significantly.

Many C types don't actually have to be resolved by Cgo, since they're only handled around as pointers. As a result, something like

void gtk_text_buffer_insert(GtkTextBuffer* buffer, GtkTextIter* iter, const char* text, int len);

can instead be

void gtk_text_buffer_insert(void* buffer, void* iter, const char* text, int len);

Doing so to all classes will have already gone a long way. Additional heuristics can be implemented to detect whether or not we'll generate code that accesses a field as well.

This may involve slight refactoring of package types to add an additional piece of information regarding the CType.

diamondburned avatar Dec 06 '21 07:12 diamondburned