On 2012-03-04 23:24, Krzysztof Żelechowski wrote:
> Why does get_temporary_buffer take a signed argument for size?
> Why is return_temporary_buffer so awkwardly named? The usual connotation
> for "return" is to provide something, not to release something.
> Why is there no exception-safe handler for temporary buffers?
The "temporary buffer" API is one example of interface, that presumably
should never have been standardized. It was part of the original HP
library and the basic idea was that it should allow implementations to
provide a very low-level wrapper to get access to some memory that can
be accessed without need to actually increase the currently reserved
heap memory buffer e.g. of malloc. Such small memory buckets can be very
useful for some algorithms that can get a significant performance win if
such a buffer is available. The experiment failed, because no vendor did
anything else but call malloc here, so the advantages of the interface
did only exist theoretically. In addition, the usage requires very
careful programming on the user-side. There exists the suggestion to
deprecate the temporary buffer API for the next standard revision, in
this case there would not be much need for providing further fixes to
the broken API.
HTH& Greetings from Bremen,
Daniel Krügler