Re: *world or *world[MAX_ROOMS_AVAILABLE

From: Mark A. Heilpern (
Date: 12/04/98

At 05:05 PM 12/4/98 +0100, you wrote:
>Whats the advantage of
>struct room_data *world = NULL;
>and then later use
>CREATE(world, struct room_data, rec_count );
>compared to *world[MAX_ROOMS_AVAILABLE]
>i.e declare a list of pointers to the max rooms that may be on the mud.

creating an array of all the rooms that may ever be available (100/zone, 326
zones, by default) would be huge and wasteful if they were not all in use.
using a smaller "max" restricts OLC of new rooms. CREATE() uses a
dynamic allocation to use just what's needed and, if a new room is created,
a new memory region will be allocated and the old one released to the system.
this makes things more efficient, in the long run.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST