[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libredwg] large file patches and issues

From: Dave Bender
Subject: Re: [libredwg] large file patches and issues
Date: Mon, 13 Oct 2014 18:19:25 -0400

Good to hear sir and good luck. I will be glad to test if you think you got the pointers properly updating.

On Oct 13, 2014 2:06 PM, "gagan" <address@hidden> wrote:
On Mon, May 12, 2014 at 10:40 AM, Dave Bender <address@hidden> wrote:
> Dear List,
>   I was working with a file containing 660,000 entries and had to make some changes. I use a hash table for handle->object index resolution to improve the parse performance by orders of magnitude (down from 14 minutes to 2 seconds). I also put in some const correctness because that's just basic. My git repo is here:
> Now for the bad news: I noticed LibreDWG stores pointers into arrays that are realloced, namely
> Dwg_Data.layer_control points into Dwg_Data.object, but this array is continually realloced and the base pointer may change.
> Dwg_Data.header.section_info also seems to be afflicted by this bug.
> Possible Dwg_Data.dwg_class* as well.
> YOU CANNOT STORE POINTERS INTO THESE ARRAYS; realloc can move the whole array somewhere else, so please store the offsets instead and calculate the pointer when needed. This is probably why some people have been seeing memory corruption.
> For my own purposes I will initialize the number of objects to 1000000 or more, depending on how big my files get. Hopefully you guys can resolve this memory issue.

Thanks for the help Dave, I'll look into it soon.

"Jai Sai Naath"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]