From e7fe36399b29fa6e5c2628cbb908a93e7e692eb7 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 14 Aug 2011 20:05:20 +0000 Subject: [PATCH] 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 --- src/ld65/lineinfo.c | 3 +++ 1 file changed, 3 insertions(+) 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--) { -- 2.39.5