Re: [flame] [new proto allocation]

From: Sammy (samedi@dhc.net)
Date: 02/18/97


On Mon, 17 Feb 1997, JTRhone wrote:

> Let's chat about a particular proto list for now, say obj_proto list.
> Well the most obvious pointers that come to mind to me are the strings
> that say the obj_proto list points to for each object.  Since all the
> loaded objects in the world (for the most part, excluding mail and other
> obscure objects) are pointing to the strings on the protos, it's pretty
> important that we make sure those pointers are not violated during a
> realloc.  Thinking about it though, I realize that those strings are not
> part of the proto list, they're somewhere else in heap world, so even if
> the obj_proto list is moved (which I would assume is very possible,
> especially on the first realloc after bootup) I don't think those strings
> are something to be worried about.  What I would be wary of, and have
> been, is not to keep any globals hanging around which relate to specific
> addresses of any part of the actual obj_proto list itself.  For example,
> if I had kept a global object ptr around pointing to obj_proto[4], if that
> obj_proto list was moved, like you pointed out, there would be a problem
> later on when we tried to reference it.  Hopefully any pointers like these
> are pointing to specific instantiations of the object and not pointing
> to the obj_proto itself.

Ah yeah now that you mention it, there probably aren't any pointers to the
actual array elements.  I suppose you'd know by now if anything was :)

I think next time I get around to working on obuild, I'll give realloc a
try.  I believe there's even a nifty little RECREATE macro to save me some
brain cells.

Sam

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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