On Sun, Sep 01, 2002 at 02:30:35AM -0400, Mike Lambert wrote: > > Small cleanups, but also a piece of my attempted fixes to the > > BUFFER_external_FLAG. (The CVS version currently doesn't work anyway, > > so don't worry about only getting parts of my fixes in; nothing > > depends on it.) > > I'm curious about your dod/external "fix". If I understood the purpose of > BUFFER_external_FLAG correctly, it indicates that the memory pointed to by > this header is external to our local memory pool, and thus should not be > collected, etc. > > However, if I understand your patch correctly, it makes all external > buffers immune to being collected. I agree with the resources.c patch to > fix external, but I'm not sure about this one.
I ran into a bug with argv getting collected when things were started up with pdb.c, and kept beating on things until the problem went away. (Though I'm not sure debug.c even uses that flag anymore...) Upon rereading the dod.c patch, I agree with your criticism. I'll leave it up to you how to fix up external stuff (whether to integrate it with selfpoolptr or whatever.) But in addition to what you and Peter have already considered, I wonder if making a separate string API entry would make sense: instead of passing any special flag to string_make(), create a separate entry string_wrap() or something.