Skip to content

Instantly share code, notes, and snippets.

View warmwaffles's full-sized avatar
🛠️
Code Wrestling

Matthew Johnston warmwaffles

🛠️
Code Wrestling
View GitHub Profile
@warmwaffles
warmwaffles / defer.c
Created September 30, 2020 22:09 — forked from jart/defer.c
Go-like defer for C that works with most optimization flag combinations under GCC/Clang
#include "gc.h"
/**
* Adds destructor to garbage shadow stack.
*
* @param frame is passed automatically by wrapper macro
* @param fn takes one argument
* @param arg is passed to fn(arg)
* @return arg
*/