#include "config.h"
#include <umem_impl.h>
#include <sys/vmem_impl_user.h>
#include "umem_base.h"
#include "vmem_base.h"
#include <sys/sysmacros.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <unistd.h>
#include "misc.h"
#define ALLOC_TABLE_1024 |
#define ALLOC_TABLE_4 &umem_null_cache, &umem_null_cache, &umem_null_cache, &umem_null_cache |
#define ALLOC_TABLE_64 |
#define CPU | ( | mask | ) | (umem_cpus + (CPUHINT() & (mask))) |
#define CPUHINT | ( | ) | (_thr_self()) |
#define CPUHINT_MAX | ( | ) | INT_MAX |
#define IN_REAP | ( | ) | IN_UPDATE() |
#define IN_UPDATE | ( | ) |
Value:
(thr_self() == umem_update_thr || \ thr_self() == umem_st_update_thr)
#define NUM_ALLOC_SIZES (sizeof (umem_alloc_sizes) / sizeof (*umem_alloc_sizes)) |
#define UMEM_AUDIT | ( | lp, | |||
cp, | |||||
bcp | ) |
Value:
{ \ umem_bufctl_audit_t *_bcp = (umem_bufctl_audit_t *)(bcp); \ _bcp->bc_timestamp = gethrtime(); \ _bcp->bc_thread = thr_self(); \ _bcp->bc_depth = getpcstack(_bcp->bc_stack, umem_stack_depth, \ (cp != NULL) && (cp->cache_flags & UMF_CHECKSIGNAL)); \ _bcp->bc_lastlog = umem_log_enter((lp), _bcp, \ UMEM_BUFCTL_AUDIT_SIZE); \ }
#define UMEM_MAXBUF 16384 |
#define UMEM_VMFLAGS | ( | umflag | ) | (VM_NOSLEEP) |
#define UMERR_BADADDR 3 |
#define UMERR_BADBASE 8 |
#define UMERR_BADBUFCTL 5 |
#define UMERR_BADBUFTAG 4 |
#define UMERR_BADCACHE 6 |
#define UMERR_BADSIZE 7 |
#define UMERR_DUPFREE 2 |
#define UMERR_MODIFIED 0 |
#define UMERR_REDZONE 1 |
thread_t _thr_self | ( | void | ) |
void* _umem_alloc | ( | size_t | size, | |
int | umflag | |||
) |
void* _umem_alloc_align | ( | size_t | size, | |
size_t | align, | |||
int | umflag | |||
) |
void* _umem_cache_alloc | ( | umem_cache_t * | cp, | |
int | umflag | |||
) |
void _umem_cache_free | ( | umem_cache_t * | cp, | |
void * | buf | |||
) |
void _umem_free | ( | void * | buf, | |
size_t | size | |||
) |
void _umem_free_align | ( | void * | buf, | |
size_t | size | |||
) |
void* _umem_zalloc | ( | size_t | size, | |
int | umflag | |||
) |
void umem_cache_applyall | ( | void(*)(umem_cache_t *) | func | ) |
umem_cache_t* umem_cache_create | ( | char * | name, | |
size_t | bufsize, | |||
size_t | align, | |||
umem_constructor_t * | constructor, | |||
umem_destructor_t * | destructor, | |||
umem_reclaim_t * | reclaim, | |||
void * | private, | |||
vmem_t * | vmp, | |||
int | cflags | |||
) |
void umem_cache_destroy | ( | umem_cache_t * | cp | ) |
void umem_cache_update | ( | umem_cache_t * | cp | ) |
int umem_init | ( | void | ) |
void umem_nofail_callback | ( | umem_nofail_callback_t * | cb | ) |
void umem_process_updates | ( | void | ) |
void umem_reap | ( | void | ) |
void umem_startup | ( | caddr_t | start, | |
size_t | len, | |||
size_t | pagesize, | |||
caddr_t | minstack, | |||
caddr_t | maxstack | |||
) |
size_t pagesize |
uint_t umem_abort = 1 |
struct { ... } umem_abort_info |
mutex_t umem_cache_lock = DEFAULTMUTEX |
size_t umem_content_log_size |
size_t umem_content_maxsave = 256 |
size_t umem_failure_log_size |
uint_t umem_flags = 0 |
mutex_t umem_flags_lock = DEFAULTMUTEX |
cond_t umem_init_cv = DEFAULTCV |
mutex_t umem_init_lock = DEFAULTMUTEX |
size_t umem_lite_maxalign = 1024 |
size_t umem_lite_minsize = 0 |
uint_t umem_logging = 0 |
uint32_t umem_max_ncpus |
caddr_t umem_max_stack |
size_t umem_maxverify |
caddr_t umem_min_stack |
size_t umem_minfirewall |
uint32_t umem_mtbf = 0 |
uint_t umem_output = 0 |
int umem_ready = UMEM_READY_STARTUP |
uint32_t umem_reap_interval = 10 |
volatile hrtime_t umem_reap_next |
volatile uint32_t umem_reaping |
size_t umem_slab_log_size |
volatile thread_t umem_st_update_thr |
uint32_t umem_stack_depth = 15 |
size_t umem_transaction_log_size |
cond_t umem_update_cv = DEFAULTCV |
mutex_t umem_update_lock = DEFAULTMUTEX |
struct timeval umem_update_next |
void* ump_buffer |
int ump_error |
void* ump_realbuf |