aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-15 21:46:24 +0100
committerlemon <lsof@mailbox.org>2025-12-15 21:46:24 +0100
commitc6c0f2ef35175075e91169113cfe856f29b3eb9a (patch)
tree65dc85d7b2845a4e1145ac9d6ffd26fbb2482e8e /common.h
parentbf0f2805b5aec7f4fa5fb4ff1a4da081a0112e4e (diff)
move intern() to mem.c
Being in lex.c was vestigial, since it was being used all over the frontend and backend.
Diffstat (limited to 'common.h')
-rw-r--r--common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common.h b/common.h
index 0d1ec4c..061c379 100644
--- a/common.h
+++ b/common.h
@@ -178,6 +178,9 @@ void free(void *);
#define xcalloc(n) xcalloc(n, __func__)
#define xrealloc(p,n) xrealloc(p, n, __func__)
+/* string interning */
+const char *intern(const char *);
+
/* growable buffer that stores its capacity in the allocated memory */
#define xbnew_(n) (void *)(1 + (size_t *)xcalloc(sizeof(size_t) + (n)))
#define xbcap_(p) ((size_t *)(p))[-1]