Use gperf to save memory.
We check terms to see if they're in the wordlist, if they are we reuse the string from the wordlist instead of allocating a new one. (I've always wanted to use Gperf so I'm pretty stoked about this!)
This commit is contained in:
@@ -9,6 +9,8 @@ GPERF_OPTS = --readonly-tables --enum --includes --global-table
|
||||
|
||||
joy: ${OBJS} $(STATIC_GCLIB)
|
||||
|
||||
keywords.c: KEYWORDS.txt
|
||||
keywords.c: KEYWORDS.txt keywords.h
|
||||
gperf --output-file=$@ --hash-function-name=keyword_hash $(GPERF_OPTS) KEYWORDS.txt
|
||||
|
||||
# keywords.c doesn't strictly depend on keywords.h, but I want make to
|
||||
# remake if keywords.h is touched.
|
||||
|
||||
Reference in New Issue
Block a user