]> git.sur5r.net Git - cc65/commitdiff
Grow the line info collection as needed before actually adding items. This
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 14 Aug 2011 20:05:20 +0000 (20:05 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 14 Aug 2011 20:05:20 +0000 (20:05 +0000)
reduces memory consumption.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5164 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ld65/lineinfo.c

index c75dec8a8c883a69e989238a528f3c38ab66389e..d56bfc3bd58c5d62f46485391ee716e3369354ae 100644 (file)
@@ -129,6 +129,9 @@ void ReadLineInfoList (FILE* F, ObjData* O, Collection* LineInfos)
     /* Read the number of line info indices that follow */
     unsigned LineInfoCount = ReadVar (F);
 
+    /* Grow the collection as needed */
+    CollGrow (LineInfos, LineInfoCount);
+
     /* Read the line infos and resolve them */
     while (LineInfoCount--) {