Abstract
In the last chapter in the book, we will implement our own memory allocation routine. We won’t implement the full generality of malloc() and friends. There is rarely a need to try to replicate something we already have code for, presumably optimized and thoroughly tested. Instead, we will implement allocation routines optimized for cases where we need to allocate many equally sized objects, and here we can improve upon the performance of the general code that needs to handle the allocation of objects of any size.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
As we know, we cannot always cast any type to any type, but the node from the pool started out as a union, then was cast to the member type, so we are allowed to cast it back.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2021 Thomas Mailund
About this chapter
Cite this chapter
Mailund, T. (2021). Allocation Pools. In: Pointers in C Programming. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6927-5_16
Download citation
DOI: https://doi.org/10.1007/978-1-4842-6927-5_16
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-6926-8
Online ISBN: 978-1-4842-6927-5
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books