diff options
Diffstat (limited to 'memstack/README.md')
-rw-r--r-- | memstack/README.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/memstack/README.md b/memstack/README.md new file mode 100644 index 0000000..7eb950e --- /dev/null +++ b/memstack/README.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # Mempool | ||
2 | |||
3 | A memory pool of fixed-sized blocks with O(1) allocation and deallocation. | ||
4 | |||
5 | Each block in the pool is tagged with a boolean value that indicates whether the | ||
6 | block is free or in use, as well as a pointer to the next free/used block. | ||
7 | Blocks thus form two lists, a free list and a used list. The allocator | ||
8 | maintains the two lists when allocating/deallocating blocks. | ||
9 | |||
10 | The allocator's internal data is stored separately from the block data so that | ||
11 | the data remains tightly packed. | ||
12 | |||
13 | Free blocks in the mempool always remain zeroed out for convenience of | ||
14 | programming and debugging. If the application's data structures are valid when | ||
15 | zeroed out, then they do not need to be explicitly initialized. | ||