summaryrefslogtreecommitdiff
path: root/include/lf.h
diff options
context:
space:
mode:
authorunknown <serg@janus.mylan>2006-10-18 17:24:07 +0200
committerunknown <serg@janus.mylan>2006-10-18 17:24:07 +0200
commit12a55aeabc353fdc1c3829ddd8baacb142160c80 (patch)
tree660c00763097e4fd6cbb954397696684f6d4b810 /include/lf.h
parent67a2b7cf298d0a351256ab13c2577c32e20bd723 (diff)
downloadmariadb-git-12a55aeabc353fdc1c3829ddd8baacb142160c80.tar.gz
lock manager passed unit tests
storage/maria/trnman.c: comments include/my_dbug.h: make DBUG_ASSERT always a statement storage/maria/lockman.h: comments include/lf.h: lf_pinbox - don't use a fixed-size purgatory. mysys/lf_alloc-pin.c: lf_pinbox - don't use a fixed-size purgatory. mysys/lf_hash.c: lf_pinbox - don't use a fixed-size purgatory. storage/maria/lockman.c: removed IGNORE_ME/UPGDARED matching - it was wrong in the first place. updated for "lf_pinbox - don't use a fixed-size purgatory" storage/maria/unittest/lockman-t.c: IGNORE_ME/UPGRADED pair counting bugtest. more tests unittest/mysys/my_atomic-t.c: lf_pinbox - don't use a fixed-size purgatory.
Diffstat (limited to 'include/lf.h')
-rw-r--r--include/lf.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/lf.h b/include/lf.h
index 4c6765b2d40..45c5f109e1c 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -96,20 +96,21 @@ typedef void lf_pinbox_free_func(void *, void *);
typedef struct {
LF_DYNARRAY pinstack;
lf_pinbox_free_func *free_func;
- void * free_func_arg;
+ void *free_func_arg;
+ uint free_ptr_offset;
uint32 volatile pinstack_top_ver; /* this is a versioned pointer */
uint32 volatile pins_in_stack; /* number of elements in array */
} LF_PINBOX;
-/* we want sizeof(LF_PINS) to be close to 128 to avoid false sharing */
+/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */
typedef struct {
void * volatile pin[LF_PINBOX_PINS];
- void * purgatory[LF_PURGATORY_SIZE];
LF_PINBOX *pinbox;
+ void *purgatory;
uint32 purgatory_count;
uint32 volatile link;
char pad[128-sizeof(uint32)*2
- -sizeof(void *)*(LF_PINBOX_PINS+LF_PURGATORY_SIZE+1)];
+ -sizeof(void *)*(LF_PINBOX_PINS+2)];
} LF_PINS;
#define lf_rwlock_by_pins(PINS) \
@@ -147,8 +148,8 @@ typedef struct {
#define _lf_assert_pin(PINS, PIN) assert((PINS)->pin[PIN] != 0)
#define _lf_assert_unpin(PINS, PIN) assert((PINS)->pin[PIN]==0)
-void lf_pinbox_init(LF_PINBOX *pinbox, lf_pinbox_free_func *free_func,
- void * free_func_arg);
+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 *,
@@ -181,7 +182,7 @@ typedef struct st_lf_allocator {
uint32 volatile mallocs;
} LF_ALLOCATOR;
-void lf_alloc_init(LF_ALLOCATOR *allocator, uint size);
+void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset);
void lf_alloc_destroy(LF_ALLOCATOR *allocator);
uint lf_alloc_in_pool(LF_ALLOCATOR *allocator);
#define _lf_alloc_free(PINS, PTR) _lf_pinbox_free((PINS), (PTR))