Re: STL, memory allocation, and cleanup (gcc 3.0?)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Elf,
Here are a few hints for you:
C++ isn't C. The stdlib was designed such that things like memory allocation
can be optimized/customized. You won't get an actual deallocation call every
time you do a delete.
If you look at the SGI STL documentation, you'll find some info on the
allocators implemented in their version. The default tries to optimize a lot
of things and there is another thread safe version, etc. If you want to have
a tighter grip on memory allocation you should define your own allocator
class which isn't hard. Just copy the interface for one of the allocator
classes, hack on it and pass it to your container classes.
I was also told that the latest releases of g++-3.x aren't that broken so you
might want to play with them to improve your standard-awareness.
Thanks,
- --
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara
www: http://www.cs.bilkent.edu.tr/~erayo
GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7/58GfAeuFodNU5wRAtWFAJ9K1u/8sggfaLvGQ9SoNhqJwoHDHgCfaZCp
Zd8RSRxlQTaJZ9QN7q7Ur3M=
=Mn9B
-----END PGP SIGNATURE-----
Reply to: