From: uz Date: Sun, 14 Aug 2011 20:05:20 +0000 (+0000) Subject: Grow the line info collection as needed before actually adding items. This X-Git-Tag: V2.13.3~298 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e7fe36399b29fa6e5c2628cbb908a93e7e692eb7;p=cc65 Grow the line info collection as needed before actually adding items. This reduces memory consumption. git-svn-id: svn://svn.cc65.org/cc65/trunk@5164 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ld65/lineinfo.c b/src/ld65/lineinfo.c index c75dec8a8..d56bfc3bd 100644 --- a/src/ld65/lineinfo.c +++ b/src/ld65/lineinfo.c @@ -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--) {