Skip to content
Heap Layers: An Extensible Memory Allocation Infrastructure
C++ C Other
Branch: master
Clone or download
emeryberger Merge pull request #26 from bpowers/musl-support
mallocheap: on linux, use <malloc.h> for malloc_usable_size
Latest commit 364bb7d Oct 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/kingsley More updating of copyright info, etc. Sep 4, 2017
heaps mallocheap: on linux, use <malloc.h> for malloc_usable_size Oct 18, 2019
legacy Updated. Mar 6, 2017
locks Removed PAUSE (see https://aloiskraus.wordpress.com/2018/06/16/why-sk… Aug 16, 2018
threads Some type casts to avoid warnings. Jul 18, 2015
utility tprintf: explicitly ignore result of write(2) calls Oct 18, 2019
wrappers
.gitignore
Alexandrescu-memory-allocation.screen.pdf Added. Sep 24, 2019
BUILD build: add Bazel build files, enabling Heap-Layers to be easily used Sep 19, 2019
COPYING
NOTICE Updated README, copied over to NOTICE. Feb 17, 2019
README.md
TODO
WORKSPACE build: add Bazel build files, enabling Heap-Layers to be easily used Sep 19, 2019
cuj-2005-12.pdf Added. Sep 24, 2019
heaplayers
heaplayers.h Revised copyright date. Oct 17, 2018

README.md

Heap Layers: An Extensible Memory Allocation Infrastructure

Copyright (C) 2000 - 2018 by Emery Berger

Heap Layers is distributed under the terms of the Apache 2.0 license.

Introduction

Heap Layers provides a flexible infrastructure for composing high-performance memory allocators out of C++ layers. Heap Layers makes it easy to write high-quality custom and general-purpose memory allocators. Heap Layers has been used successfully to build a number of high-performance allocators, including Hoard and DieHard.

Using Heap Layers

For an introduction to Heap Layers, read the article Policy-Based Memory Allocation, by Andrei Alexandrescu and Emery Berger. It's a good overview. See also "Memory Allocation: Either Love It or Hate It (or just think it’s okay)", a talk by Andrei.

Heap Layers contains a number of ready-made heap components that can be plugged together with minimal effort, and the result is often faster than hand-built allocators. The PLDI 2001 paper Composing High-Performance Memory Allocators has plenty of examples.

Performance

Heap Layers can substantially outperform its only real competitor, the Vmalloc package from AT&T. The OOPSLA 2002 paper Reconsidering Custom Memory Allocation paper has more details.

Not only is Heap Layers much higher level and simpler to use, but its use of templates also improves performance. Heap Layers both eliminates the function call overhead imposed by Vmalloc layers and yields higher quality code by exposing more optimization opportunities.

Citation

To reference Heap Layers in an academic paper, please cite as follows:

@inproceedings{DBLP:conf/pldi/BergerZM01,
  author    = {Emery D. Berger and
               Benjamin G. Zorn and
               Kathryn S. McKinley},
  title     = {Composing High-Performance Memory Allocators},
  booktitle = {Proceedings of the 2001 {ACM} {SIGPLAN} Conference on Programming
               Language Design and Implementation (PLDI), Snowbird, Utah, USA, June
               20-22, 2001},
  pages     = {114--124},
  year      = {2001},
  crossref  = {DBLP:conf/pldi/2001},
  url       = {https://doi.org/10.1145/378795.378821},
  doi       = {10.1145/378795.378821},
  timestamp = {Wed, 14 Nov 2018 10:54:59 +0100},
  biburl    = {https://dblp.org/rec/bib/conf/pldi/BergerZM01},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@proceedings{DBLP:conf/pldi/2001,
  editor    = {Michael Burke and
               Mary Lou Soffa},
  title     = {Proceedings of the 2001 {ACM} {SIGPLAN} Conference on Programming
               Language Design and Implementation (PLDI), Snowbird, Utah, USA, June
               20-22, 2001},
  publisher = {{ACM}},
  year      = {2001},
  url       = {http://dl.acm.org/citation.cfm?id=378795},
  isbn      = {1-58113-414-2},
  timestamp = {Mon, 21 May 2012 16:19:53 +0200},
  biburl    = {https://dblp.org/rec/bib/conf/pldi/2001},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
You can’t perform that action at this time.