]> git.sur5r.net Git - cc65/blobdiff - src/ca65/objcode.c
Use a string pool to reduce the memory footprint
[cc65] / src / ca65 / objcode.c
index f483fabeae35393ecc155416d511b1ef87418c50..bbb42b8f18488cff36dd04a40d1bd2274a4a47c9 100644 (file)
@@ -39,6 +39,7 @@
 /* common */
 #include "chartype.h"
 #include "check.h"
+#include "fragdefs.h"
 #include "segdefs.h"
 #include "segnames.h"
 #include "xmalloc.h"
 #include "global.h"
 #include "lineinfo.h"
 #include "listing.h"
+#include "objcode.h"
 #include "objfile.h"
 #include "scanner.h"
+#include "spool.h"
 #include "symtab.h"
-#include "objcode.h"
 
 
 
@@ -420,11 +422,11 @@ static void WriteOneSeg (Segment* Seg)
     ObjWrite32 (0);
 
     /* Write the segment data */
-    ObjWriteStr (Seg->Def->Name);       /* Name of the segment */
-    ObjWrite32 (Seg->PC);               /* Size */
-    ObjWrite8 (Seg->Align);             /* Segment alignment */
-    ObjWrite8 (Seg->Def->Type);         /* Type of the segment */
-    ObjWriteVar (Seg->FragCount);       /* Number of fragments that follow */
+    ObjWriteVar (GetStringId (Seg->Def->Name)); /* Name of the segment */
+    ObjWrite32 (Seg->PC);                       /* Size */
+    ObjWrite8 (Seg->Align);                     /* Segment alignment */
+    ObjWrite8 (Seg->Def->Type);                 /* Type of the segment */
+    ObjWriteVar (Seg->FragCount);               /* Number of fragments */
 
     /* Now walk through the fragment list for this segment and write the
      * fragments.