| 1 | Here is a glossary of terms used in FastMalloc. Sometimes, more than one term is used for the same thing. |
| 2 | |
| 3 | '''sizeclass | class''' |
| 4 | {{{ |
| 5 | number from [1, kNumClasses] identifying a size grouping |
| 6 | 0 sizeclass means large allocation |
| 7 | objects of the same sizeclass: |
| 8 | have the same true allocation size |
| 9 | are in the same free list |
| 10 | }}} |
| 11 | |
| 12 | '''classindex''' |
| 13 | {{{ |
| 14 | location of 'size' in the sizeclass array |
| 15 | classindex values are cached to avoid repeat math |
| 16 | }}} |
| 17 | |
| 18 | |
| 19 | '''span | descriptor''' |
| 20 | {{{ |
| 21 | metadata for a contiguous run of pages |
| 22 | either a single large allocation or |
| 23 | parceled into bytesize(sizeclass) units |
| 24 | maintains a free list for those units |
| 25 | maintains a total reference count for those units |
| 26 | }}} |
| 27 | |
| 28 | |
| 29 | '''pagemap''' |
| 30 | {{{ |
| 31 | [pageID => span] mapping for all pageIDs in the address space |
| 32 | more than one pageID can map to the same span |
| 33 | }}} |
| 34 | |
| 35 | |
| 36 | '''page''' |
| 37 | {{{ |
| 38 | kPageSize chunk of memory |
| 39 | }}} |
| 40 | |
| 41 | |
| 42 | '''pageID''' |
| 43 | {{{ |
| 44 | number from [0, kNumPages] identifying a page |
| 45 | pageID * kPageSize = address of page |
| 46 | }}} |
| 47 | |
| 48 | '''object''' |
| 49 | {{{ |
| 50 | item in a free list |
| 51 | }}} |
| 52 | |
| 53 | '''split (verb)''' |
| 54 | {{{ |
| 55 | break a span into two parts (used by memalign) |
| 56 | }}} |
| 57 | |
| 58 | '''carve (verb)''' |
| 59 | {{{ |
| 60 | allocate a span, possibly splitting it (used by pageheap allocation functions) |
| 61 | }}} |
| 62 | |
| 63 | '''pageheap''' |
| 64 | {{{ |
| 65 | central span and page allocator |
| 66 | requires locking |
| 67 | maintains the pagemap |
| 68 | keeps free spanlists for spans |
| 69 | }}} |
| 70 | |
| 71 | '''spanlist''' |
| 72 | {{{ |
| 73 | 2 linked lists of spans: |
| 74 | mmaped (vm live) |
| 75 | madvised (vm dead) |
| 76 | }}} |
| 77 | |
| 78 | '''threadcache | heap | threadheap''' |
| 79 | {{{ |
| 80 | per-thread free lists for various size classes |
| 81 | }}} |
| 82 | |
| 83 | '''central_cache''' |
| 84 | {{{ |
| 85 | central list for size classes |
| 86 | one lock per list |
| 87 | all normal-sized allocation originates in the central_cache (but may be cached in a threadcache) |
| 88 | }}} |
| 89 | |