Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C GENERIC PROGRAMMING?

Name: Anonymous 2011-02-13 12:02

http://dis.4chan.org/read/prog/1297507372/56

i was reworking my memory manager a little bit (trying to get rid of memset initialization by keeping a mem_biggest_used_index variable) and i suddenly noticed that there's another problem i didn't consider: i'll have to duplicate all this code for every type of object pool i want. i'll need at least a pool for items and another one for NPCs. WHAT DO NOW?!

i found some code online and threw up in my mouth, is this how it's done in C?

http://www.flipcode.com/archives/Faking_Templates_In_C.shtml

Name: OP 2011-02-13 12:45

>>4
yah, i don't really know what i'm doing... just trying to wrestle myself through this. i checked out the links, mem slices look really interesting, might be just what i need. still, for the sake of learning something, i think i'll try to carry on with this code for a day or two longer.

anyways, now is time for me to get hgih so i'll ttyl when i reviewed the links and my options... for some reason i believe turning mem_pool into a void* + a lot of casts (and a macro or two) might work...

i'll report back later

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List