32.4. Memory: Coda
This chapter has provided an introduction to a whole range of memory types, and we've discussed the trade-offs between efficiency and flexibility for the different types. We've also seen how the selection of allocators represents the same trade-off. A really good way to maximize flexibility and efficiency is to combine the techniques that have been presented. In other words, using a per-call dynamic specification of allocator along with auto_buffer can be a way to have all the flexibility you need with respect to your source of heap memory, while only going to the potentially expensive heaps in the minority cases.
|