123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|685|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Freeing memory in B3D

Mon, 03 Jan 2011, 14:00
JL235
The handles for entities are essentially just ints. So your code should be correct.

How do you know the ram isn't being freed. Are you running out of memory?

Also I doubt the entity is using up ram (or at least very little). It'll be using video memory instead.
Mon, 03 Jan 2011, 16:28
HoboBen
Possibly fragmentation of memory - things being created, then freed all over the place might lead to blocks of memory too small to fit new objects in again, so the memory used has to grow.

Particle engines usually create a fixed size amount of particles at once and simply hide/show them. This means that there's no costly memory allocation and also no fragmentation. You could use a similar technique for your bullets.



-=-=-
blog | work | code | more code
Mon, 03 Jan 2011, 16:32
JL235
If he is freeing them then fragmentation wouldn't be an issue. It would only affect performance.
Wed, 05 Jan 2011, 03:24
Teasy