Static allocation of opaque data types
You can use the _alloca function. I believe that it’s not exactly Standard, but as far as I know, nearly all common compilers implement it. When you use it as a default argument, it allocates off the caller’s stack. // Header typedef struct {} something; int get_size(); something* create_something(void* mem); // Usage handle* ptr = … Read more