I've been slowly writing a small library for development on PSP (I'm trying to adapt my existing engine which I am very familiar with to the PSP), however it seems there's something I'm missing with c++ and class memory usage.
Basically I've written a bunch of classes (there's only around 5-10) which I have written implementations for all but 1 (1 is also partially done). My problem is as soon as I include even just the header for the classes (implementations are in a .cpp file that is included at the end of the header), my PSP's available memory drops from around 23000KB to around 1000KB...
It stays consistent at the same size every time I run the program (all it does is setup callbacks and show available memory in debug screen) no matter how much is in the header/cpp file of mine - I have tried cutting out all but 2 classes and compiling and the usage is the same.
There are some variables declared, but even removing them doesn't change the usage :S
I've tried a few things that have done absolutely nothing to change the memory usage so I wanted to ask for a bit of help on the matter.
For reference, a typical class of mine looks like this:
Code: Select all
class SpriteInstLE : public BaseLE {
friend class ParticleLE;
private:
SpriteLE *basesprite; // Pointer to base sprite
SPRITEANIMDATA animation; // Animation struct
unsigned short colour[4]; // Sprite colour
VECTOR3 position; // 3D point struct
VECTOR3 velocity;
VECTOR3 acceleration;
public:
// Member functions are declared but not implemented here
};
Thanks,
yotryu