CMGDK r49-rc2
组合类型 | 宏定义 | 类型定义 | 函数 | 变量
K:/CMGDKv18/SDK/Source/SQL/MySQL/include/lf.h文件参考
#include <my_atomic.h>
#include <hash.h>

浏览该文件的源代码。

组合类型

struct  LF_DYNARRAY
struct  LF_PINBOX
struct  LF_PINS
struct  LF_HASH

宏定义

#define lock_wrap(f, t, proto_args, args, lock)
#define lock_wrap_void(f, proto_args, args, lock)
#define nolock_wrap(f, t, proto_args, args)
#define nolock_wrap_void(f, proto_args, args)
#define LF_DYNARRAY_LEVEL_LENGTH   256
#define LF_DYNARRAY_LEVELS   4
#define LF_PINBOX_PINS   4
#define LF_PURGATORY_SIZE   10
#define lf_rwlock_by_pins(PINS)   my_atomic_rwlock_wrlock(&(PINS)->pinbox->pinarray.lock)
#define lf_rwunlock_by_pins(PINS)   my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.lock)
#define LF_REQUIRE_PINS(N)
#define _lf_pin(PINS, PIN, ADDR)   my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR))
#define _lf_unpin(PINS, PIN)   _lf_pin(PINS, PIN, NULL)
#define lf_pin(PINS, PIN, ADDR)
#define lf_unpin(PINS, PIN)   lf_pin(PINS, PIN, NULL)
#define _lf_assert_pin(PINS, PIN)   assert((PINS)->pin[PIN] != 0)
#define _lf_assert_unpin(PINS, PIN)   assert((PINS)->pin[PIN] == 0)
#define _lf_alloc_free(PINS, PTR)   _lf_pinbox_free((PINS), (PTR))
#define lf_alloc_free(PINS, PTR)   lf_pinbox_free((PINS), (PTR))
#define _lf_alloc_get_pins(A)   _lf_pinbox_get_pins(&(A)->pinbox)
#define lf_alloc_get_pins(A)   lf_pinbox_get_pins(&(A)->pinbox)
#define _lf_alloc_put_pins(PINS)   _lf_pinbox_put_pins(PINS)
#define lf_alloc_put_pins(PINS)   lf_pinbox_put_pins(PINS)
#define lf_alloc_direct_free(ALLOC, ADDR)   my_free((uchar*)(ADDR), MYF(0))
#define LF_HASH_UNIQUE   1
#define _lf_hash_get_pins(HASH)   _lf_alloc_get_pins(&(HASH)->alloc)
#define lf_hash_get_pins(HASH)   lf_alloc_get_pins(&(HASH)->alloc)
#define _lf_hash_put_pins(PINS)   _lf_pinbox_put_pins(PINS)
#define lf_hash_put_pins(PINS)   lf_pinbox_put_pins(PINS)
#define lf_hash_search_unpin(PINS)   lf_unpin((PINS), 2)

类型定义

typedef int(* lf_dynarray_func )(void *, void *)

函数

void lf_dynarray_init (LF_DYNARRAY *array, uint element_size)
void lf_dynarray_destroy (LF_DYNARRAY *array)
 nolock_wrap (lf_dynarray_value, void *,(LF_DYNARRAY *array, uint idx),(array, idx)) lock_wrap(lf_dynarray_lvalue
void LF_DYNARRAY uint &array lock nolock_wrap (lf_dynarray_iterate, int,(LF_DYNARRAY *array, lf_dynarray_func func, void *arg),(array, func, arg)) typedef void lf_pinbox_free_func(void *
void lf_pinbox_init (LF_PINBOX *pinbox, uint free_ptr_offset, lf_pinbox_free_func *free_func, void *free_func_arg)
void lf_pinbox_destroy (LF_PINBOX *pinbox)
 lock_wrap (lf_pinbox_get_pins, LF_PINS *,(LF_PINBOX *pinbox),(pinbox),&pinbox->pinarray.lock) lock_wrap_void(lf_pinbox_put_pins
LF_PINS &pins pinbox pinarray lock lock_wrap_void (lf_pinbox_free,(LF_PINS *pins, void *addr),(pins, addr),&pins->pinbox->pinarray.lock) typedef struct st_lf_allocator
void lf_alloc_init (LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset)
void lf_alloc_destroy (LF_ALLOCATOR *allocator)
uint lf_alloc_pool_count (LF_ALLOCATOR *allocator)
 lock_wrap (lf_alloc_new, void *,(LF_PINS *pins),(pins),&pins->pinbox->pinarray.lock) extern const int LF_HASH_OVERHEAD
void lf_hash_init (LF_HASH *hash, uint element_size, uint flags, uint key_offset, uint key_length, my_hash_get_key get_key, CHARSET_INFO *charset)
void lf_hash_destroy (LF_HASH *hash)
int lf_hash_insert (LF_HASH *hash, LF_PINS *pins, const void *data)
void * lf_hash_search (LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
int lf_hash_delete (LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)

变量

void LF_DYNARRAYarray
void LF_DYNARRAY uint idx
LF_PINSpins
 LF_ALLOCATOR

宏定义文档

#define _lf_alloc_free (   PINS,
  PTR 
)    _lf_pinbox_free((PINS), (PTR))
#define _lf_alloc_get_pins (   A)    _lf_pinbox_get_pins(&(A)->pinbox)
#define _lf_alloc_put_pins (   PINS)    _lf_pinbox_put_pins(PINS)
#define _lf_assert_pin (   PINS,
  PIN 
)    assert((PINS)->pin[PIN] != 0)
#define _lf_assert_unpin (   PINS,
  PIN 
)    assert((PINS)->pin[PIN] == 0)
#define _lf_hash_get_pins (   HASH)    _lf_alloc_get_pins(&(HASH)->alloc)
#define _lf_hash_put_pins (   PINS)    _lf_pinbox_put_pins(PINS)
#define _lf_pin (   PINS,
  PIN,
  ADDR 
)    my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR))
#define _lf_unpin (   PINS,
  PIN 
)    _lf_pin(PINS, PIN, NULL)
#define lf_alloc_direct_free (   ALLOC,
  ADDR 
)    my_free((uchar*)(ADDR), MYF(0))
#define lf_alloc_free (   PINS,
  PTR 
)    lf_pinbox_free((PINS), (PTR))
#define lf_alloc_get_pins (   A)    lf_pinbox_get_pins(&(A)->pinbox)
#define lf_alloc_put_pins (   PINS)    lf_pinbox_put_pins(PINS)
#define LF_DYNARRAY_LEVEL_LENGTH   256
#define LF_DYNARRAY_LEVELS   4
#define lf_hash_get_pins (   HASH)    lf_alloc_get_pins(&(HASH)->alloc)
#define lf_hash_put_pins (   PINS)    lf_pinbox_put_pins(PINS)
#define lf_hash_search_unpin (   PINS)    lf_unpin((PINS), 2)
#define LF_HASH_UNIQUE   1
#define lf_pin (   PINS,
  PIN,
  ADDR 
)
值:
do {                            \
    lf_rwlock_by_pins(PINS);      \
    _lf_pin(PINS, PIN, ADDR);     \
    lf_rwunlock_by_pins(PINS);    \
  } while (0)
#define LF_PINBOX_PINS   4
#define LF_PURGATORY_SIZE   10
#define LF_REQUIRE_PINS (   N)
#define lf_rwlock_by_pins (   PINS)    my_atomic_rwlock_wrlock(&(PINS)->pinbox->pinarray.lock)
#define lf_rwunlock_by_pins (   PINS)    my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.lock)
#define lf_unpin (   PINS,
  PIN 
)    lf_pin(PINS, PIN, NULL)
#define lock_wrap (   f,
  t,
  proto_args,
  args,
  lock 
)
值:
t _ ## f proto_args;                            \
static inline t f  proto_args                   \
{                                               \
  t ret;                                        \
  my_atomic_rwlock_wrlock(lock);                \
  ret= _ ## f args;                             \
  my_atomic_rwlock_wrunlock(lock);              \
  return ret;                                   \
}
#define lock_wrap_void (   f,
  proto_args,
  args,
  lock 
)
值:
void _ ## f proto_args;                         \
static inline void f proto_args                 \
{                                               \
  my_atomic_rwlock_wrlock(lock);                \
  _ ## f args;                                  \
  my_atomic_rwlock_wrunlock(lock);              \
}
#define nolock_wrap (   f,
  t,
  proto_args,
  args 
)
值:
t _ ## f proto_args;                            \
static inline t f  proto_args                   \
{                                               \
  return _ ## f args;                           \
}
#define nolock_wrap_void (   f,
  proto_args,
  args 
)
值:
void _ ## f proto_args;                         \
static inline void f proto_args                 \
{                                               \
  _ ## f args;                                  \
}

类型定义文档

typedef int(* lf_dynarray_func)(void *, void *)

函数文档

void lf_alloc_destroy ( LF_ALLOCATOR allocator)
void lf_alloc_init ( LF_ALLOCATOR allocator,
uint  size,
uint  free_ptr_offset 
)
uint lf_alloc_pool_count ( LF_ALLOCATOR allocator)
void lf_dynarray_destroy ( LF_DYNARRAY array)
void lf_dynarray_init ( LF_DYNARRAY array,
uint  element_size 
)
int lf_hash_delete ( LF_HASH hash,
LF_PINS pins,
const void *  key,
uint  keylen 
)
void lf_hash_destroy ( LF_HASH hash)
void lf_hash_init ( LF_HASH hash,
uint  element_size,
uint  flags,
uint  key_offset,
uint  key_length,
my_hash_get_key  get_key,
CHARSET_INFO charset 
)
int lf_hash_insert ( LF_HASH hash,
LF_PINS pins,
const void *  data 
)
void* lf_hash_search ( LF_HASH hash,
LF_PINS pins,
const void *  key,
uint  keylen 
)
void lf_pinbox_destroy ( LF_PINBOX pinbox)
void lf_pinbox_init ( LF_PINBOX pinbox,
uint  free_ptr_offset,
lf_pinbox_free_func *  free_func,
void *  free_func_arg 
)
lock_wrap ( lf_alloc_new  ,
void *  ,
(LF_PINS *pins ,
(pins ,
&pins->pinbox->pinarray.  lock 
) const
lock_wrap ( lf_pinbox_get_pins  ,
LF_PINS ,
(LF_PINBOX *pinbox)  ,
(pinbox)  ,
&pinbox->pinarray.  lock 
)
LF_PINS & pins pinbox pinarray lock lock_wrap_void ( lf_pinbox_free  ,
(LF_PINS *pins, void *addr ,
(pins, addr ,
&pins->pinbox->pinarray.  lock 
)
void LF_DYNARRAY uint & array lock nolock_wrap ( lf_dynarray_iterate  ,
int  ,
(LF_DYNARRAY *array, lf_dynarray_func func, void *arg)  ,
(array, func, arg)   
)
nolock_wrap ( lf_dynarray_value  ,
void *  ,
(LF_DYNARRAY *array, uint idx ,
(array, idx  
)

变量文档

 全部  名字空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义