Aaron Stone wrote:
Glib will kill compatibility with other programming languages for making extensions to dbmail. Most notably anything that uses those exported libraries.Sounds interesting, though slightly distracting at this particular moment, nevertheless, a good thing to look into over the course of 2.0. For 2.1 and beyond, there's lots of talk about glib. I'm ambivalent, sort of a "too good to be true" but glib really does have everything that we need, done right.
WRT garbage collection, glib, which provides some of this functionality and
also some more interestitng functionality. My favorite tool is the memory
pool, which glib provides with nesting features, too. The best situation for
this is nested loops, where each inner loop needs to allocate some data which
is used once by the loop outside of it. So...
pool_init(outer);
while(foo) {
pool_init(inner);
while(bar) {
pool_alloc(innner, stuff);
bar--;
}
if (strcmp(something, inner))
pool_alloc(outer, junk));
pool_free(inner);
}
pool_free(outer);
Here's another neat concept, it creates new memory frames and let's you free
the entire thing all at once when you're done with a section of code:
http://irccrew.org/~cras/security/data-stack.html
Objective-C/GNUstep has something called NSAutoreleasePool, which is the
best implementation of this at this moment in time. It is kind of like
garbage collection only the pool stores which things have been
registered and which things are using it, and once the retain count has
hit 0 it releases it.
Dan
Aaron -- _______________________________________________ Dbmail-dev mailing list [email protected] http://twister.fastxs.net/mailman/listinfo/dbmail-dev
signature.asc
Description: OpenPGP digital signature
