Re: Re: Going up a directory takes long

Home › Forums › Development › Going up a directory takes long › Re: Re: Going up a directory takes long

#28289
Borgland
Member

See wiimc.cpp:
browserList = (BROWSERENTRY *)mem2_malloc(sizeof(BROWSERENTRY)*MAX_BROWSER_SIZE, VIDEO_AREA);
Doesn’t matter if it has less than 2000, at the moment this is the memory allocated in the MEM2 area called VIDEO_AREA.

Ok, I missed that one, you are right.

You can just as easily use structs, malloc, etc. I’m not completely opposed to C++, but also realize that it is going to use more memory up to use classes – C++ increases the footprint.

I want to use a class to encapsulate the browser list idea. One advantage is that it hides the details of the relationship between the browser struct and browserList list. If a programmer has to call AddBrowserEntry() every time he/she wants to add a new entry to the browser AND remember to call browser.numEntries++; eventually someone will forget, and cause a bug.

How about, we start addressing the larger memory issues first. Can I change browserList to be of type std::vector so that the initialization of all 2000 entries isn’t done upfront?