Compiler now reuses existing strings in the data, read more

If a string exists in the data, instead of being written, the function
'emitCStringToData()' will instead return the address of the match
within the data section.

Then, I can search the jump table for that address, and use the existing
jump entry or append a new one.

Fixes #168
This commit is contained in:
2025-02-08 17:27:47 +11:00
parent 72f4e4c143
commit 7c054db9e6
3 changed files with 143 additions and 17 deletions

View File

@@ -126,7 +126,7 @@ void Toy_bindModuleBundle(Toy_ModuleBundle* bundle, unsigned char* ptr, unsigned
memcpy(bundle->ptr, ptr, size);
bundle->count = size;
//URGENT: test this
//TODO: test this
int valid = validateModuleBundleHeader(bundle);
if (valid < 0) {