diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
commit | 65ca700def99289cc31a7040537f5aa6e12bf485 (patch) | |
tree | 97b3a07299b626c519da0e80c122b5b79b933914 /include/lf.h | |
parent | 2ab57de38d13d927ddff2d51aed4af34e13998f5 (diff) | |
parent | 6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff) | |
download | mariadb-git-65ca700def99289cc31a7040537f5aa6e12bf485.tar.gz |
merge.
checkpoint.
does not compile.
Diffstat (limited to 'include/lf.h')
-rw-r--r-- | include/lf.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/lf.h b/include/lf.h index e9fb094493f..9698086bacf 100644 --- a/include/lf.h +++ b/include/lf.h @@ -115,10 +115,11 @@ typedef struct { void *purgatory; uint32 purgatory_count; uint32 volatile link; -/* we want sizeof(LF_PINS) to be 64 to avoid false sharing */ -#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+3) != 64 - char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+3)]; -#endif +/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */ + char pad[128-sizeof(uint32)*2 + -sizeof(LF_PINBOX *) + -sizeof(void*) + -sizeof(void *)*(LF_PINBOX_PINS+1)]; } LF_PINS; /* @@ -187,6 +188,8 @@ typedef struct st_lf_allocator { uchar * volatile top; uint element_size; uint32 volatile mallocs; + void (*constructor)(uchar *); /* called, when an object is malloc()'ed */ + void (*destructor)(uchar *); /* called, when an object is free()'d */ } LF_ALLOCATOR; void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset); @@ -220,7 +223,8 @@ C_MODE_START #define LF_HASH_UNIQUE 1 -/* lf_hash overhead per element is sizeof(LF_SLIST). */ +/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ +extern const int LF_HASH_OVERHEAD; typedef struct { LF_DYNARRAY array; /* hash itself */ |