HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How did it work?

05-18-2007, 03:10 PM#1
IKilledKenny
Hello, I used until now (for a month or so, maybe even more) KaTTaNa's local handle system, however, I never created a global gamecache (I didn't know that was needed) and it worked perfectly! Now however I just saw that you should create one.

How did the triggers work if I didn't create the gamecache?

Thanks.
05-18-2007, 03:23 PM#2
Vexorian
They constantly used InitGameCache.

The things you had that used such previous "local handle system" (which is the worst way possible to name it) had plenty, heck loads of memory leaks.

That's the difference.
05-19-2007, 08:35 PM#3
IKilledKenny
Thanks Vexorain, so you are saying that the fact that I didn't use a global variable caused leaks. Can please explain why?
05-19-2007, 08:38 PM#4
Pyrogasm
I believe it has something to do with creating new GameChaches constantly.
05-19-2007, 09:26 PM#5
SFilip
Indeed, quite simply the system created a new gamecache every time you tried to store or read anything. It worked fine because these caches used the same filename, but you would keep hundreds of unused gamecaches inside your memory.
05-19-2007, 10:19 PM#6
Joker
Are structs the only alternative?
05-20-2007, 10:40 AM#7
MaD[Lion]
well if you dont want to use gamecache then struct is the only alternative yes. Also structs are just a smart way to use arrays. So you can also use array. But struct make tat alot more simple to write.

Gamecache doesnt leak if u use it right, but it's just slow