Ignore:
Timestamp:
May 28, 2007 11:49:46 AM (14 years ago)
Author:
bennylp
Message:

Fixed ticket #304: Memory alignment error for hash entry buffer causing crash on ARM (thanks ChenHuan?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/hash.c

    r1235 r1307  
    101101    unsigned table_size; 
    102102     
    103     /* Check that PJ_HASH_ENTRY_SIZE is correct. */ 
    104     PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); 
     103    /* Check that PJ_HASH_ENTRY_BUF_SIZE is correct. */ 
     104    PJ_ASSERT_RETURN(sizeof(pj_hash_entry)<=PJ_HASH_ENTRY_BUF_SIZE, NULL); 
    105105 
    106106    h = PJ_POOL_ALLOC_T(pool, pj_hash_table_t); 
     
    238238PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht, 
    239239                             const void *key, unsigned keylen,  
    240                              pj_uint32_t hval, void *entry_buf, void *value) 
     240                             pj_uint32_t hval, pj_hash_entry_buf entry_buf,  
     241                             void *value) 
    241242{ 
    242243    pj_hash_entry **p_entry; 
    243244 
    244     p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf ); 
     245    p_entry = find_entry( NULL, ht, key, keylen, value, &hval,  
     246                         (void*)entry_buf ); 
    245247    if (*p_entry) { 
    246248        if (value == NULL) { 
Note: See TracChangeset for help on using the changeset viewer.