On Monday 22 April 2002 03:50 pm, Daniel Byer wrote:
> I notice some of the structs contained in, say, a ROOM_INDEX_DATA,
> need perm memory (via the perm_alloc() function) in the initialization
> (load_rooms, db.c). Would I need to perm_alloc my TRACK_DATA, assuming
> its a linked list, in load_rooms()? Or simple a malloc()? Or do I
> malloc()/free() as the tracking code is being executed (i.e. need to
> initalize a new TRACK_DATA struct in a room when a player enters it for
> the first time, and free it when the tracks expire)?

Most likely you will just put a pointer into room_index_data to the new 
tracking data type.  Only that pointer will be allocated with the room, and 
it doesn't take up a lot of space.  Then, as the people walk through the 
rooms, you will have to allocate the new data type (with perm_alloc if you 
want to keep a separate free pool of empty tracking structures, or with 
alloc_mem if you want to use the general memory pool) and link it into the 
room's list.
--Palrich.

Reply via email to