mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 03:53:33 +00:00
33e8fc8687
You can now do epic things like this: puts(_gc(xasprintf("%d", 123))); The _gc() API is shorthand for _defer() which works like Go's keyword: const char *s = xasprintf("%d", 123); _defer(free, s); puts(s); Be sure to always use -fno-omit-frame-pointer which makes code fast too. Enjoy! See also #114
10 lines
341 B
C
10 lines
341 B
C
#ifndef COSMOPOLITAN_LIBC_RUNTIME_GC_INTERNAL_H_
|
|
#define COSMOPOLITAN_LIBC_RUNTIME_GC_INTERNAL_H_
|
|
#include "libc/runtime/gc.h"
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
#define gc(THING) _gc(THING)
|
|
#define defer(FN, ARG) _defer(FN, ARG)
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_RUNTIME_GC_INTERNAL_H_ */
|