01-29-2013 11:49 AM
@jyang72211 wrote:
Each element of the 1D array contains a file path name. For my application, the array won't be too big, just a 2000 at most. However, I just want to know what's the best way to handle the memory.
Keep in mind that building a new array of paths doesn't mean you're creating a new copy of every path. You're just creating an additional pointer (4 or 8 bytes depending on whether you're on a 32 or 64 bit platform) to the path, unless you're modifying the path somehow before inserting it in the new array.
01-29-2013 02:48 PM
Just throwing this out there: if a contiguous space of memory were a concern (still not 100% sure from reading the above posts what you're looking for), you can try storing data in a queue and taking it out as you want. If I'm not mistaken, a queue doesn't store the data contiguously in memory. Not sure if this is what you're looking for, but it can be a help if a large single space of memory is the concern.
