mt_allocator issues.
Dhruv Matani
dhruvbird@gmx.net
Wed Mar 17 22:42:00 GMT 2004
Hello,
This is regarding mainly the _S_get_options and set_options.
Once the allocator is instantiated, can the user use these 2 functions
safely?
Is the user ment to use them in the first place, or are they only for
internal library configuration?
If they are not ment for users, it would be better to make the data
members const, allowing the compiler to perform optimizations on them.
One particular part that looks dicy to me is the deallocate function,
which uses divide operator twice on a non-const data member, thus
no-optimizations are possible.
However, we usually use a value of 10 for that particular value.
Currently, the optimization that gcc does by divide by 10 is that it
makes it a multiply instruction (somehow! help reqd. here please!!!).
However with the multiply, the instruction speed could be further
reduced by more than half for a divide by 10 which can be done without
actually dividing.
I can send in the code if required.
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
Proud to be a Vegetarian.
http://www.vegetarianstarterkit.com/
http://www.vegkids.com/vegkids/index.html
More information about the Libstdc++
mailing list