--- In [email protected], "brucexs" <bruc...@...> wrote:

> I agree: You don't have to do anything with regard to vectors for above.

Okay, so here's another scenario:  I'm thinking of a service in database 
plugins that will do what Sheri;s done with her ADODB script;
return a vector, each element of which contains an instance of a 
class-plugin-generated struct, fill of values for a record.

(1)  I assume it would be more efficient to create a struct with 
class.definestruct, then keep spawning instances of that struct for each record 
(the alternative being to create an "anonymous" instance for each record using 
class.makestruct).

(2) In either case, I end up with many instances of structs, each of which will 
start life with refcnt zero, each of which will end up with ref cnt 1 when I 
call 

  ppVecServices->set_vec(pszhVec, iNdx, pszhStructInst)

so I've nothing to do there.

(3) But if I go for creating a struct by calling e.g.

  ppsv->CallPlugin("class", "definestruct", pszBuf, 3,
    "StructForRecord", "field1 field2", 30);

the handle it returns has never been put in a variable, never will be, never 
accessible to user.  Assuming it's more efficient to use a struct to create 
many instances, what will cause the struct to get 
removed when it's no longer needed?  Will it cease to exist as soon as last 
instance on which it's based ceases to exist?

I'm sure I could find out by reading your code.  But I'm lazy.  



Reply via email to