From c6c0f2ef35175075e91169113cfe856f29b3eb9a Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 15 Dec 2025 21:46:24 +0100 Subject: move intern() to mem.c Being in lex.c was vestigial, since it was being used all over the frontend and backend. --- common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common.h') 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] -- cgit v1.2.3