|
umem
1.0.1
|
#include <umem.h>#include <sys/sysmacros.h>#include <sys/time.h>#include <sys/vmem.h>#include "sol_compat.h"Go to the source code of this file.
Classes | |
| struct | umem_bufctl |
| struct | umem_bufctl_audit |
| struct | umem_buftag |
| struct | umem_slab |
| struct | umem_magazine |
| struct | umem_magtype |
| struct | umem_cpu_cache |
| struct | umem_maglist |
| struct | umem_cache |
| struct | umem_cpu_log_header |
| struct | umem_log_header |
| struct | umem_cpu |
Macros | |
| #define | UMC_QCACHE 0x00100000 |
| #define | UMC_INTERNAL 0x80000000 |
| #define | UMF_AUDIT 0x00000001 /* transaction auditing */ |
| #define | UMF_DEADBEEF 0x00000002 /* deadbeef checking */ |
| #define | UMF_REDZONE 0x00000004 /* redzone checking */ |
| #define | UMF_CONTENTS 0x00000008 /* freed-buffer content logging */ |
| #define | UMF_CHECKSIGNAL 0x00000010 /* abort when in signal context */ |
| #define | UMF_NOMAGAZINE 0x00000020 /* disable per-cpu magazines */ |
| #define | UMF_FIREWALL 0x00000040 /* put all bufs before unmapped pages */ |
| #define | UMF_LITE 0x00000100 /* lightweight debugging */ |
| #define | UMF_HASH 0x00000200 /* cache has hash table */ |
| #define | UMF_RANDOMIZE 0x00000400 /* randomize other umem_flags */ |
| #define | UMF_BUFTAG (UMF_DEADBEEF | UMF_REDZONE) |
| #define | UMF_TOUCH (UMF_BUFTAG | UMF_LITE | UMF_CONTENTS) |
| #define | UMF_RANDOM (UMF_TOUCH | UMF_AUDIT | UMF_NOMAGAZINE) |
| #define | UMF_DEBUG (UMF_RANDOM | UMF_FIREWALL) |
| #define | UMEM_STACK_DEPTH umem_stack_depth |
| #define | UMEM_FREE_PATTERN 0xdeadbeefdeadbeefULL |
| #define | UMEM_UNINITIALIZED_PATTERN 0xbaddcafebaddcafeULL |
| #define | UMEM_REDZONE_PATTERN 0xfeedfacefeedfaceULL |
| #define | UMEM_REDZONE_BYTE 0xbb |
| #define | UMEM_FATAL_FLAGS (UMEM_NOFAIL) |
| #define | UMEM_SLEEP_FLAGS (0) |
| #define | UMEM_SIZE_ENCODE(x) (251 * (x) + 1) |
| #define | UMEM_SIZE_DECODE(x) ((x) / 251) |
| #define | UMEM_SIZE_VALID(x) ((x) % 251 == 1) |
| #define | UMEM_BUFCTL_AUDIT_SIZE_DEPTH(frames) ((size_t)(&((umem_bufctl_audit_t *)0)->bc_stack[frames])) |
| #define | UMEM_BUFCTL_AUDIT_ALIGN 32 |
| #define | UMEM_BUFCTL_AUDIT_MAX_SIZE |
| #define | UMEM_MAX_STACK_DEPTH |
| #define | UMEM_LOCAL_BUFCTL_AUDIT(bcpp) |
| #define | UMEM_BUFCTL_AUDIT_SIZE UMEM_BUFCTL_AUDIT_SIZE_DEPTH(UMEM_STACK_DEPTH) |
| #define | UMEM_BUFTAG(cp, buf) ((umem_buftag_t *)((char *)(buf) + (cp)->cache_buftag)) |
| #define | UMEM_BUFCTL(cp, buf) ((umem_bufctl_t *)((char *)(buf) + (cp)->cache_bufctl)) |
| #define | UMEM_BUF(cp, bcp) ((void *)((char *)(bcp) - (cp)->cache_bufctl)) |
| #define | UMEM_SLAB(cp, buf) ((umem_slab_t *)P2END((uintptr_t)(buf), (cp)->cache_slabsize) - 1) |
| #define | UMEM_CPU_CACHE(cp, cpu) (umem_cpu_cache_t *)((char *)cp + cpu->cpu_cache_offset) |
| #define | UMEM_MAGAZINE_VALID(cp, mp) |
| #define | UMEM_SLAB_MEMBER(sp, buf) |
| #define | UMEM_BUFTAG_ALLOC 0xa110c8edUL |
| #define | UMEM_BUFTAG_FREE 0xf4eef4eeUL |
| #define | UMEM_HASH_INITIAL 64 |
| #define | UMEM_HASH(cp, buf) |
| #define | UMEM_CPU_CACHE_SIZE 64 /* must be power of 2 */ |
| #define | UMEM_CPU_PAD |
| #define | UMEM_CACHE_SIZE(ncpus) ((size_t)(&((umem_cache_t *)0)->cache_cpu[ncpus])) |
| #define | UMEM_CACHE_NAMELEN 31 |
| #define | UMEM_MAXBUF 16384 |
| #define | UMEM_ALIGN 8 /* min guaranteed alignment */ |
| #define | UMEM_ALIGN_SHIFT 3 /* log2(UMEM_ALIGN) */ |
| #define | UMEM_VOID_FRACTION 8 /* never waste more than 1/8 of slab */ |
| #define | UMEM_SECOND_ALIGN UMEM_ALIGN |
| #define | MALLOC_MAGIC 0x3a10c000 /* 8-byte tag */ |
| #define | MEMALIGN_MAGIC 0x3e3a1000 |
| #define | UMEM_MALLOC_ENCODE(type, sz) (uint32_t)((type) - (sz)) |
| #define | UMEM_MALLOC_DECODE(stat, sz) (uint32_t)((stat) + (sz)) |
| #define | UMEM_FREE_PATTERN_32 (uint32_t)(UMEM_FREE_PATTERN) |
| #define | UMU_MAGAZINE_RESIZE 0x00000001 |
| #define | UMU_HASH_RESCALE 0x00000002 |
| #define | UMU_REAP 0x00000004 |
| #define | UMU_NOTIFY 0x08000000 |
| #define | UMU_ACTIVE 0x80000000 |
| #define | UMEM_READY_INIT_FAILED -1 |
| #define | UMEM_READY_STARTUP 1 |
| #define | UMEM_READY_INITING 2 |
| #define | UMEM_READY 3 |
Typedefs | |
| typedef struct umem_bufctl | umem_bufctl_t |
| typedef struct umem_bufctl_audit | umem_bufctl_audit_t |
| typedef struct umem_buftag | umem_buftag_t |
| typedef struct umem_slab | umem_slab_t |
| typedef struct umem_magazine | umem_magazine_t |
| typedef struct umem_magtype | umem_magtype_t |
| typedef struct umem_cpu_cache | umem_cpu_cache_t |
| typedef struct umem_maglist | umem_maglist_t |
| typedef struct umem_cpu_log_header | umem_cpu_log_header_t |
| typedef struct umem_log_header | umem_log_header_t |
| typedef struct umem_cpu | umem_cpu_t |
| #define MALLOC_MAGIC 0x3a10c000 /* 8-byte tag */ |
Referenced by malloc().
| #define MEMALIGN_MAGIC 0x3e3a1000 |
Referenced by memalign().
| #define UMC_INTERNAL 0x80000000 |
Referenced by umem_cache_create().
| #define UMC_QCACHE 0x00100000 |
Referenced by umem_cache_create().
| #define UMEM_ALIGN 8 /* min guaranteed alignment */ |
Referenced by _umem_alloc_align(), and memalign().
| #define UMEM_ALIGN_SHIFT 3 /* log2(UMEM_ALIGN) */ |
Referenced by _umem_alloc(), _umem_free(), and _umem_zalloc().
| #define UMEM_BUF | ( | cp, | |
| bcp | |||
| ) | ((void *)((char *)(bcp) - (cp)->cache_bufctl)) |
| #define UMEM_BUFCTL | ( | cp, | |
| buf | |||
| ) | ((umem_bufctl_t *)((char *)(buf) + (cp)->cache_bufctl)) |
| #define UMEM_BUFCTL_AUDIT_ALIGN 32 |
| #define UMEM_BUFCTL_AUDIT_MAX_SIZE |
| #define UMEM_BUFCTL_AUDIT_SIZE UMEM_BUFCTL_AUDIT_SIZE_DEPTH(UMEM_STACK_DEPTH) |
| #define UMEM_BUFCTL_AUDIT_SIZE_DEPTH | ( | frames | ) | ((size_t)(&((umem_bufctl_audit_t *)0)->bc_stack[frames])) |
| #define UMEM_BUFTAG | ( | cp, | |
| buf | |||
| ) | ((umem_buftag_t *)((char *)(buf) + (cp)->cache_buftag)) |
| #define UMEM_BUFTAG_ALLOC 0xa110c8edUL |
| #define UMEM_BUFTAG_FREE 0xf4eef4eeUL |
| #define UMEM_CACHE_NAMELEN 31 |
| #define UMEM_CACHE_SIZE | ( | ncpus | ) | ((size_t)(&((umem_cache_t *)0)->cache_cpu[ncpus])) |
Referenced by umem_cache_create().
| #define UMEM_CPU_CACHE | ( | cp, | |
| cpu | |||
| ) | (umem_cpu_cache_t *)((char *)cp + cpu->cpu_cache_offset) |
Referenced by _umem_cache_alloc(), and _umem_cache_free().
| #define UMEM_CPU_CACHE_SIZE 64 /* must be power of 2 */ |
Referenced by umem_cache_create(), and umem_init().
| #define UMEM_CPU_PAD |
| #define UMEM_FATAL_FLAGS (UMEM_NOFAIL) |
| #define UMEM_FREE_PATTERN 0xdeadbeefdeadbeefULL |
| #define UMEM_FREE_PATTERN_32 (uint32_t)(UMEM_FREE_PATTERN) |
| #define UMEM_HASH | ( | cp, | |
| buf | |||
| ) |
| #define UMEM_HASH_INITIAL 64 |
Referenced by umem_cache_update().
| #define UMEM_LOCAL_BUFCTL_AUDIT | ( | bcpp | ) |
| #define UMEM_MAGAZINE_VALID | ( | cp, | |
| mp | |||
| ) |
| #define UMEM_MALLOC_DECODE | ( | stat, | |
| sz | |||
| ) | (uint32_t)((stat) + (sz)) |
| #define UMEM_MALLOC_ENCODE | ( | type, | |
| sz | |||
| ) | (uint32_t)((type) - (sz)) |
Referenced by malloc(), and memalign().
| #define UMEM_MAX_STACK_DEPTH |
| #define UMEM_MAXBUF 16384 |
| #define UMEM_READY 3 |
Referenced by umem_cache_create(), umem_init(), and vmem_heap_arena().
| #define UMEM_READY_INIT_FAILED -1 |
Referenced by umem_init().
| #define UMEM_READY_INITING 2 |
Referenced by umem_init().
| #define UMEM_READY_STARTUP 1 |
Referenced by umem_init(), and umem_startup().
| #define UMEM_REDZONE_BYTE 0xbb |
| #define UMEM_REDZONE_PATTERN 0xfeedfacefeedfaceULL |
| #define UMEM_SECOND_ALIGN UMEM_ALIGN |
Referenced by malloc(), and memalign().
| #define UMEM_SIZE_DECODE | ( | x | ) | ((x) / 251) |
| #define UMEM_SIZE_ENCODE | ( | x | ) | (251 * (x) + 1) |
| #define UMEM_SIZE_VALID | ( | x | ) | ((x) % 251 == 1) |
| #define UMEM_SLAB | ( | cp, | |
| buf | |||
| ) | ((umem_slab_t *)P2END((uintptr_t)(buf), (cp)->cache_slabsize) - 1) |
| #define UMEM_SLAB_MEMBER | ( | sp, | |
| buf | |||
| ) |
| #define UMEM_SLEEP_FLAGS (0) |
| #define UMEM_STACK_DEPTH umem_stack_depth |
| #define UMEM_UNINITIALIZED_PATTERN 0xbaddcafebaddcafeULL |
| #define UMEM_VOID_FRACTION 8 /* never waste more than 1/8 of slab */ |
| #define UMF_AUDIT 0x00000001 /* transaction auditing */ |
Referenced by umem_init().
| #define UMF_BUFTAG (UMF_DEADBEEF | UMF_REDZONE) |
Referenced by _umem_cache_alloc(), and _umem_cache_free().
| #define UMF_CHECKSIGNAL 0x00000010 /* abort when in signal context */ |
| #define UMF_CONTENTS 0x00000008 /* freed-buffer content logging */ |
| #define UMF_DEADBEEF 0x00000002 /* deadbeef checking */ |
| #define UMF_DEBUG (UMF_RANDOM | UMF_FIREWALL) |
| #define UMF_FIREWALL 0x00000040 /* put all bufs before unmapped pages */ |
| #define UMF_HASH 0x00000200 /* cache has hash table */ |
Referenced by umem_cache_update().
| #define UMF_LITE 0x00000100 /* lightweight debugging */ |
| #define UMF_NOMAGAZINE 0x00000020 /* disable per-cpu magazines */ |
| #define UMF_RANDOM (UMF_TOUCH | UMF_AUDIT | UMF_NOMAGAZINE) |
| #define UMF_RANDOMIZE 0x00000400 /* randomize other umem_flags */ |
| #define UMF_REDZONE 0x00000004 /* redzone checking */ |
| #define UMF_TOUCH (UMF_BUFTAG | UMF_LITE | UMF_CONTENTS) |
| #define UMU_ACTIVE 0x80000000 |
Referenced by umem_process_updates().
| #define UMU_HASH_RESCALE 0x00000002 |
Referenced by umem_cache_update(), and umem_process_updates().
| #define UMU_MAGAZINE_RESIZE 0x00000001 |
| #define UMU_NOTIFY 0x08000000 |
| #define UMU_REAP 0x00000004 |
| typedef struct umem_bufctl_audit umem_bufctl_audit_t |
| typedef struct umem_bufctl umem_bufctl_t |
| typedef struct umem_buftag umem_buftag_t |
| typedef struct umem_cpu_cache umem_cpu_cache_t |
| typedef struct umem_cpu_log_header umem_cpu_log_header_t |
| typedef struct umem_cpu umem_cpu_t |
| typedef struct umem_log_header umem_log_header_t |
| typedef struct umem_magazine umem_magazine_t |
| typedef struct umem_maglist umem_maglist_t |
| typedef struct umem_magtype umem_magtype_t |
| typedef struct umem_slab umem_slab_t |
1.8.14