umem_impl.h File Reference

#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

Defines

#define UMC_QCACHE   0x00100000
#define UMC_INTERNAL   0x80000000
#define UMF_AUDIT   0x00000001
#define UMF_DEADBEEF   0x00000002
#define UMF_REDZONE   0x00000004
#define UMF_CONTENTS   0x00000008
#define UMF_CHECKSIGNAL   0x00000010
#define UMF_NOMAGAZINE   0x00000020
#define UMF_FIREWALL   0x00000040
#define UMF_LITE   0x00000100
#define UMF_HASH   0x00000200
#define UMF_RANDOMIZE   0x00000400
#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
#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
#define UMEM_ALIGN_SHIFT   3
#define UMEM_VOID_FRACTION   8
#define UMEM_SECOND_ALIGN   UMEM_ALIGN
#define MALLOC_MAGIC   0x3a10c000
#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 Documentation

#define MALLOC_MAGIC   0x3a10c000

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(), and vmem_create().

#define UMEM_ALIGN   8

#define UMEM_ALIGN_SHIFT   3

#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

Value:

#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]))

#define UMEM_CPU_CACHE ( cp,
cpu   )     (umem_cpu_cache_t *)((char *)cp + cpu->cpu_cache_offset)

#define UMEM_CPU_CACHE_SIZE   64

Referenced by umem_cache_create(), and umem_init().

#define UMEM_CPU_PAD

Value:

(UMEM_CPU_CACHE_SIZE - sizeof (mutex_t) - \
        2 * sizeof (uint_t) - 2 * sizeof (void *) - 4 * sizeof (int))

#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   ) 

Value:

((cp)->cache_hash_table +       \
        (((uintptr_t)(buf) >> (cp)->cache_hash_shift) & (cp)->cache_hash_mask))

#define UMEM_HASH_INITIAL   64

#define UMEM_LOCAL_BUFCTL_AUDIT ( bcpp   ) 

Value:

#define UMEM_MAGAZINE_VALID ( cp,
mp   ) 

Value:

(((umem_slab_t *)P2END((uintptr_t)(mp), PAGESIZE) - 1)->slab_cache == \
            (cp)->cache_magtype->mt_cache)

#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

Value:

#define UMEM_MAXBUF   16384

#define UMEM_READY   3

#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

Referenced by _umem_free().

#define UMEM_SECOND_ALIGN   UMEM_ALIGN

Referenced by malloc(), memalign(), and umem_cache_create().

#define UMEM_SIZE_DECODE (  )     ((x) / 251)

#define UMEM_SIZE_ENCODE (  )     (251 * (x) + 1)

#define UMEM_SIZE_VALID (  )     ((x) % 251 == 1)

Referenced by _umem_free().

#define UMEM_SLAB ( cp,
buf   )     ((umem_slab_t *)P2END((uintptr_t)(buf), (cp)->cache_slabsize) - 1)

#define UMEM_SLAB_MEMBER ( sp,
buf   ) 

Value:

((size_t)(buf) - (size_t)(sp)->slab_base < \
            (sp)->slab_cache->cache_slabsize)

#define UMEM_SLEEP_FLAGS   (0)

#define UMEM_STACK_DEPTH   umem_stack_depth

#define UMEM_UNINITIALIZED_PATTERN   0xbaddcafebaddcafeULL

#define UMEM_VOID_FRACTION   8

Referenced by umem_cache_create().

#define UMF_AUDIT   0x00000001

Referenced by umem_cache_create(), and umem_init().

#define UMF_BUFTAG   (UMF_DEADBEEF | UMF_REDZONE)

#define UMF_CHECKSIGNAL   0x00000010

#define UMF_CONTENTS   0x00000008

#define UMF_DEADBEEF   0x00000002

Referenced by umem_cache_create().

#define UMF_DEBUG   (UMF_RANDOM | UMF_FIREWALL)

Referenced by umem_cache_create().

#define UMF_FIREWALL   0x00000040

Referenced by umem_cache_create().

#define UMF_HASH   0x00000200

#define UMF_LITE   0x00000100

Referenced by umem_cache_create().

#define UMF_NOMAGAZINE   0x00000020

Referenced by umem_cache_create().

#define UMF_RANDOM   (UMF_TOUCH | UMF_AUDIT | UMF_NOMAGAZINE)

Referenced by umem_cache_create().

#define UMF_RANDOMIZE   0x00000400

Referenced by umem_cache_create().

#define UMF_REDZONE   0x00000004

Referenced by umem_cache_create().

#define UMF_TOUCH   (UMF_BUFTAG | UMF_LITE | UMF_CONTENTS)

Referenced by umem_cache_create().

#define UMU_ACTIVE   0x80000000

Referenced by umem_process_updates().

#define UMU_HASH_RESCALE   0x00000002

#define UMU_MAGAZINE_RESIZE   0x00000001

#define UMU_NOTIFY   0x08000000

Referenced by umem_process_updates().

#define UMU_REAP   0x00000004

Referenced by umem_process_updates(), and umem_reap().


Typedef Documentation

typedef struct umem_bufctl umem_bufctl_t

typedef struct umem_buftag umem_buftag_t

typedef struct umem_cpu umem_cpu_t

typedef struct umem_maglist umem_maglist_t

typedef struct umem_magtype umem_magtype_t

typedef struct umem_slab umem_slab_t


Generated on Wed Sep 9 01:07:05 2009 for umem by  doxygen 1.5.9