GP32 Linked Lists.


Takashi

Still Fresh
Joined
Nov 21, 2003
Messages
23
As I said, I know how linked lists work, I know how they are applied, and yes, even implement them - I made a C++ CrystalSpace object management plug-in, and have sucessefully completed several college programming courses in C.

But let's say that I am extremelly lazy in this summer. Also, that I don't like to code that mutch, and mutch less repeat something other people have already done. What I am looking is a nice, pre-made C linked-list library of sorts that I can modify to support a simple linked struct, with add_record, fetch_record, etc.

I'm using SDL, if it matters to anybody - how is the speed on GP32 16-bit mode? I've heard it was terribly slow and this code has a slight action vein.
 
What you need is STL, or just slap a list template together and there you go.

---
mithris
 
Well, I already knew SDL, but won't it bloat pure C code, since it's a C++ abstraction?
 
True, C++ adds a little overhead, but i wouldn't worry much about it these days, virtual methods etc. could be avoided in time critical cases. But other than that i think it's more or less a matter of taste.

---
mithris
 
Whenever I wanted to do something like this and can't be bothered implementing my own linked list for whatever reason, I normally just create a structure (or class) and slap it into a vector. The vector gives you all the insert, remove, find, etc that you'd normally use a linked list for, and since it's a template, it can be used for any variable type.
 
assuming you use optimizing flags like "-O2" or "-Os" (my personal favorite).
I learned the very hard way, that "-Os" bad thing to use on GP32, because it seems to result is a mixture of 16 and 32 bit code (at least with 16bit stereo, that I was using). Running that kind of code interfere with the sound output. It took me a week and 5 different playroutines to find that one. :blink: Besides that "-O3" produces much faster code for GP32.

On Linux I still use -Os ;)

Greetings,
SvOlli
 
Last edited by a moderator:
Thank you for your support! I ended up using STL vectors, since they seem more suitable for what I'm looking for.

Here's something for your troubles:

play1.gif
 
Back
Top