memory allocation - DS

Started by
11 comments, last by ZMaster 16 years, 11 months ago
Quote:Original post by Palidine
Quote:Original post by PaoloStoppa
It should be very simple, as it is often required in programming.


Nothing is simple when programming for consoles. non-PC hardware is _very_ fussy about how and when things are done.

Quote:Original post by nagromo
It's not a free operation, either, although it should be pretty fast.


Memory allocation is often one of the slowest operations you can do. Certainly it appears "fast" for things with long lifetimes, but allocating memory will often be a bottleneck for things like particle engines or projectiles. That's why game programmers spend so much time writing memory managers that do only a single malloc at the beginning of the application and then just pass pointers to people asking for memory.

-me


Okey, i did not know, that this is such a difficult thing at game programming. Perhaps, it is quicker, if I seek for an existing memory allocation code, and then I use that ?

Advertisement
Quote:Original post by PaoloStoppa
Quote:Original post by Palidine
Quote:Original post by PaoloStoppa
It should be very simple, as it is often required in programming.


Nothing is simple when programming for consoles. non-PC hardware is _very_ fussy about how and when things are done.

Quote:Original post by nagromo
It's not a free operation, either, although it should be pretty fast.


Memory allocation is often one of the slowest operations you can do. Certainly it appears "fast" for things with long lifetimes, but allocating memory will often be a bottleneck for things like particle engines or projectiles. That's why game programmers spend so much time writing memory managers that do only a single malloc at the beginning of the application and then just pass pointers to people asking for memory.

-me


Okey, i did not know, that this is such a difficult thing at game programming. Perhaps, it is quicker, if I seek for an existing memory allocation code, and then I use that ?


Okey, i now use an existing allocation code. I run the programm, and at

pmonster=new CMonster, I go an ensata error message :

Stopped due to abort or undefined instruction in ARM9.

Whz is this error ?



Paolo

Quote:Original post by PaoloStoppa
Okey, i now use an existing allocation code. I run the programm, and at

pmonster=new CMonster, I go an ensata error message :

Stopped due to abort or undefined instruction in ARM9.

Whz is this error ?



Paolo


Unfortunately, this is the only error message of ensata that I've ever run into and it can mean everything that has to do with memory: eg. Double freeing memory blocks, writing to / reading from freed memory, writing to / reading from memory that has not been allocated, writing / reading out of array bounds, etc.

Regarding your the error message you posted earlier, you probably did not initialize the heap arena at the correct point in your program. Apart from the main application entry point you do have a start-up function, where memory initializations go! I won't post any more details, because of the NDAs I wrote about earlier!

By the way, you shouldn't post any Nitro SDK specific code on this board! Nintendo will get to your balls, if they hear about that. You are violating contracts. However, I do appreciate that you hold the opinion of people on this board in such high esteem, but the official newsgroup is read (and replied to) by many Nintendo officials and people from other, well experienced, development teams with Nitro licenses, you would have probably had a solution to your problem in fewer time, too!

Cheers!

This topic is closed to new replies.

Advertisement