diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-05-28 11:49:46 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-05-28 11:49:46 +0000 |
commit | 7c28b42ad3fd73d9d7f07b0ebfd3b7f501d71a9f (patch) | |
tree | 7a03c60792cca873cba6f1b5255e932fec4bc861 /pjlib/src | |
parent | 26be3e55bedc2f31559151d2608aa338badfbbed (diff) |
Fixed ticket #304: Memory alignment error for hash entry buffer causing crash on ARM (thanks ChenHuan)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1307 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r-- | pjlib/src/pj/hash.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index 5b3454d9..2e13f450 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -100,8 +100,8 @@ PJ_DEF(pj_hash_table_t*) pj_hash_create(pj_pool_t *pool, unsigned size) pj_hash_table_t *h; unsigned table_size; - /* Check that PJ_HASH_ENTRY_SIZE is correct. */ - PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); + /* Check that PJ_HASH_ENTRY_BUF_SIZE is correct. */ + PJ_ASSERT_RETURN(sizeof(pj_hash_entry)<=PJ_HASH_ENTRY_BUF_SIZE, NULL); h = PJ_POOL_ALLOC_T(pool, pj_hash_table_t); h->count = 0; @@ -237,11 +237,13 @@ PJ_DEF(void) pj_hash_set( pj_pool_t *pool, pj_hash_table_t *ht, PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht, const void *key, unsigned keylen, - pj_uint32_t hval, void *entry_buf, void *value) + pj_uint32_t hval, pj_hash_entry_buf entry_buf, + void *value) { pj_hash_entry **p_entry; - p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf ); + p_entry = find_entry( NULL, ht, key, keylen, value, &hval, + (void*)entry_buf ); if (*p_entry) { if (value == NULL) { /* delete entry */ |