Skip to main content

Allocation Pools

  • Chapter
  • First Online:
Pointers in C Programming
  • 1798 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Thomas Mailund

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics