Use a string pool to reduce the memory footprint

git-svn-id: svn://svn.cc65.org/cc65/trunk@2197 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-06-04 12:40:14 +00:00
parent 4937cd236f
commit edde7a3f45
27 changed files with 551 additions and 374 deletions

View File

@@ -49,6 +49,10 @@
/* An invalid message index */
#define INVALID_STRING_ID 0U
/* The string pool we're using */
extern StringPool StrPool;
@@ -69,6 +73,19 @@ INLINE unsigned GetStringId (const char* S)
# define GetStringId(S) SP_Add (&StrPool, (S))
#endif
#if defined(HAVE_INLINE)
INLINE const char* GetString (unsigned Index)
/* Convert a string index into a string */
{
return SP_Get (&StrPool, Index);
}
#else
# define GetString(Index) SP_Get (&StrPool, (Index))
#endif
void InitStrPool (void);
/* Initialize the string pool */
/* End of spool.h */