Closed kjhermans closed 5 years ago
I'd suggest it's left intact as this helps reduce JSMN's memory footprint in memory-constrained environments like microcontrollers (and I think this library is actually often used in those). If it's really problematic I think a different solution should be implemented.
But you malloc() those things, right? the jsmntok_t's, I mean.
Allocate them yourself, yes.
Ok. I suppose I'll just have to stick with forcibly defining the macro in the header file itself, as a patch.
Now as the library is just a .h file it's not a problem anymore
If you have an #ifdef in your structure definitions, the size of your structure, as perceived by the compiler, may vary, depending on whether the user is compiling the .c file themselves or not / have the #define on or off in different Makefiles. I suggest to take away the #ifdef JSMN_PARENT_LINKS in the jsmntok_t.