4 ms·
So you're saying the runtime mallocs the pointer to the closure and it's your responsibility to free it when you don't need it anymore?
by PaulHoule 1y ago
So you're saying the runtime mallocs the pointer to the closure and it's your responsibility to free it when you don't need it anymore?
- ori_b 1y agoKinda. Here's an example: void mkclosure(int x) { int x; void fn(void){ return x + 1; } return fnheapify(fn); } void useclosure(void) { void (^fn)(void) = mkclosure(42); fn(); fnfree(fn); }