Date: 2000-05-09 11:15:14
Hello, all -
No, I'm not dead :) I've been working on 'pool' some.
. Merged all the free lists into one
. Written an m4 script[*] for automatically generating families of
. Implemented an instance-based allocator
. Implemented a standard allocator
To do (in order that I plan to do them):
. Review allocator implementations [I sort of had to hack them in order to
guarantee Y(U(y)) == y]
. Allow the option of making the number of elements allocated in each
block a run-time instead of compile-time constant [I have an idea on how to
do this, but have to work out the details]
. Fix the #ifndef DEBUG's in the headers
. Clean up documentation and put in separate files
. Provide some easy method (or examples) of how to integrate with
new/delete - a) per-class basis, b) global operators, and c) automatic
freeing via set_new_handler [Each of these is really hairy and has a lot of
. Evaluate possible use as an object factory helper -- maybe sample code
[*] - for those who are not familiar with m4:
Unix users - it's on your system. Trust me; Autoconf uses it.
M$ users - you can download it from
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/m4-14b.zip (and the docs
are in m4-14d.zip) -- just unzip it into some directory and add the subdir
'bin' to your path and you're all set to go.
Macintosh users - ? (I don't know)
Maybe there's a better way to generate the code than m4. I just picked it
because it's standard Unix, and there's ports for M$ already available. All
I use it for is to make preprocessor loops, such as emulating a "#for(...)"
Anyway, the size of the included file grows rapidly (O(4 ** N)) with the
number of arguments supported. Some quick examples:
# of args Size of file
1 2 K
2 5 K
3 22 K
4 98 K
5 436 K
6 1.92 M
7 8.39 M
Based on these, I've set up '3' to be the default number of arguments
supported. A new include file can be generated by running
'pool_construct.bat' (passing the number of arguments requested as a
parameter), which runs m4 on 'pool_construct.m4', generating
'pool_construct.inc'. A Unix shell script is also included, but untested.
The new pool is in the vault. It contains some macros and classes that may,
in the future, go in other libraries (such as BOOST_POSTULATE and ct_gcd).
It depends on shared_ptr and type_traits.
P.S. I have compiled this under BCB4 and Borland's free command-line
P.P.S. The new 'pool' in the vault is the zip file. All other files and
directories in that folder are no longer necessary -- if a list owner would
be so kind as to delete them :)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk