Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2000-11-30 13:58:01


First as moderator I'm going to hold my vote until I've had a really good
look at this very interesting code.

First I have some code comments.
____________

Yep, those headers should have the .hpp extension.

____________

in pool.h

  ~pool()
I dislike
   if (list.begin() == 0)

It breaks what I think of as the iterator concept. If what is meant is
   if (list.uninitialized() )

  or
   if (list.empty() )

that should be used instead.

-------

  class PODptr should have a default constructor, rather than hide the
default data in sized_pool. (It's partly stylistic but when you use a value
as an indicator of uninitialized IMO it should be done all within the class,
and not by the calling class.)

________

call me confused but the comment about using std::less_equal and std::less
doesn't make sense to me. It states that the standard operators may return
unspecified results, yet when I look at the source to these functors, they
use the standard operators. Does the standard specify that for void * types
these functors will return a valid result and not the operators >= and > ?

___________

I agree guard and mutex belong in their own details namespace. In fact pool
belongs in its own namespace.

____________

design issue:
It's been a while since I've had a project which required my own memory
pools but in the past I tended to use them in conjunction with a specific
container, allocating all of the memory for that container from one pool.
That's all fine and dandy but then it appears that these pools will overlap
for any data of a similar size. While that is interesting, it does mean that
the pool can't go away until all of the memory allocated of a specific size
does. It's not exactly what I would have wished for. Does anyone else have
any specific data on this sort of shared pool technique? I've seen it used
by a replacement for malloc on a system wide memory replacement. Am I
wishing for things I didn't really want?

For debugging I'd also like a couple of flags one of which did a
initialization of the memory to a known value that uninitialized code would
likely crash if deferenced, ie 0xDEADCODE and another of which
did fence post testing, ie, mark the beginning and end of a valid block,
and test for overwrite on deletion. Then on deletion, re-initialize the
memory to 0xDCDCDCDC. And last but not least a report of the unfreed blocks.
This is a Future wish list, and because an item appears in my dreams
only means I should get cracking and add it! Instead of whining that someone
else should do it. :)

_________

Next: on IE5 the font for the copyright is unreadable. Its way too small.
(small point, but the fact that its on the top of the page and makes this
fuzz mess is annoying.)

    More later,
   -gary-

gary.powell_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk