memleaks in dll mode

Release and discuss things you've made, including mods.
Post Reply
User avatar
freem
Programmer
Posts: 215
Joined: Mon Feb 11, 2013 1:02 pm UTC

memleaks in dll mode

Post by freem »

I believe I have a hint on the memleaks and memory problems in local dll solo instances (which mostly are used when debugging).
I'm currently in the process or redoing the configuration system (no, this won't land in master, or at least I won't do any effort in this direction) and I see that shared/*.cpp files are included in both sgame and cgame. This may seem obvious, but bear with me a bit longer.
Some of those files contains "static" instances of stuff, like all gameplay elements (weapons, upgrades, classes, missiles, buildings). Those files will be included in both dll files. There are several threads around according to pstree, more than just daemon, cgame and sgame.
When debugging my replacement code, I clearly have several instances of things like bg_weapons (the "unique" memory array that contains info about all "weapons").

my guess, that I think might help upstream find and fix problems, is that there are 1 memory area named bg_weapons per loaded dll (they're static after all) and that in some circumstances, the code might address the wrong memory area.

Post Reply