summaryrefslogtreecommitdiff
path: root/mysys/waiting_threads.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mysql.com>2008-11-03 20:33:34 +0100
committerSergei Golubchik <serg@mysql.com>2008-11-03 20:33:34 +0100
commitf91219ed47604ac80c378bd917431fa42e4cb1d9 (patch)
tree6ed02d819c875200438461a38fdc8491b02c89db /mysys/waiting_threads.c
parentca4d512aa46df2f231940d20f1b94b8409a7c691 (diff)
downloadmariadb-git-f91219ed47604ac80c378bd917431fa42e4cb1d9.tar.gz
don't use #pragma pack
include/waiting_threads.h: don't #pragma pack mysys/lf_hash.c: typo in a comment mysys/waiting_threads.c: use the size of data, not the size of (possibly padded) structure
Diffstat (limited to 'mysys/waiting_threads.c')
-rw-r--r--mysys/waiting_threads.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c
index ef19018831b..edabc25ee51 100644
--- a/mysys/waiting_threads.c
+++ b/mysys/waiting_threads.c
@@ -280,7 +280,7 @@ void wt_init()
DBUG_ENTER("wt_init");
lf_hash_init(&reshash, sizeof(WT_RESOURCE), LF_HASH_UNIQUE, 0,
- sizeof(struct st_wt_resource_id), 0, 0);
+ sizeof_WT_RESOURCE_ID, 0, 0);
reshash.alloc.constructor= wt_resource_init;
reshash.alloc.destructor= wt_resource_destroy;
/*
@@ -396,9 +396,7 @@ void wt_thd_destroy(WT_THD *thd)
*/
int wt_resource_id_memcmp(void *a, void *b)
{
- /* assert that the structure is not padded with random bytes */
- compile_time_assert(sizeof(WT_RESOURCE_ID)==sizeof(ulonglong)+sizeof(void*));
- return memcmp(a, b, sizeof(WT_RESOURCE_ID));
+ return memcmp(a, b, sizeof_WT_RESOURCE_ID);
}
/**
@@ -657,7 +655,7 @@ static int unlock_lock_and_free_resource(WT_THD *thd, WT_RESOURCE *rc)
/* XXX if (rc->id.type->make_key) key= rc->id.type->make_key(&rc->id, &keylen); else */
{
key= &rc->id;
- keylen= sizeof(rc->id);
+ keylen= sizeof_WT_RESOURCE_ID;
}
/*
@@ -751,7 +749,7 @@ int wt_thd_will_wait_for(WT_THD *thd, WT_THD *blocker, WT_RESOURCE_ID *resid)
/* XXX if (restype->make_key) key= restype->make_key(resid, &keylen); else */
{
key= resid;
- keylen= sizeof(*resid);
+ keylen= sizeof_WT_RESOURCE_ID;
}
DBUG_PRINT("wt", ("first blocker"));