diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-04 21:13:50 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-04 21:13:50 -0500 |
| commit | adde91636f04ae7544dba1ca5c6c1a40c074edb9 (patch) | |
| tree | dfeb8c0c16fda6a87ef30b048b070ee4cb175a78 /builtins/memory.c | |
| parent | b08a0d3e2bf45bae11c982dd24d0292d6436b993 (diff) | |
Builtins
Diffstat (limited to 'builtins/memory.c')
| -rw-r--r-- | builtins/memory.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/builtins/memory.c b/builtins/memory.c new file mode 100644 index 00000000..4db6ca39 --- /dev/null +++ b/builtins/memory.c @@ -0,0 +1,33 @@ + +#include <gc.h> +#include <gc/cord.h> +#include <stdalign.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <ctype.h> +#include <sys/param.h> +#include <err.h> + +#include "types.h" +#include "../util.h" +#include "../SipHash/halfsiphash.h" + +extern const void *SSS_HASH_VECTOR; + +public CORD Memory__cord(const void *p, bool colorize, const TypeInfo *type) { + (void)type; + CORD cord; + CORD_sprintf(&cord, colorize ? "\x1b[0;34;1mMemory<%p>\x1b[m" : "Memory<%p>", p); + return cord; +} + +public TypeInfo Memory_type = { + .name="Memory", + .size=0, + .align=0, + .tag=CustomInfo, + .CustomInfo={.cord=(void*)Memory__cord}, +}; + +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
