Ignore:
Timestamp:
May 28, 2007 12:01:51 PM (17 years ago)
Author:
bennylp
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/pjproject-0.5-stable/pjlib/src/pj/hash.c

    r1185 r1308  
    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(pool, sizeof(pj_hash_table_t)); 
     
    237237PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht, 
    238238                             const void *key, unsigned keylen,  
    239                              pj_uint32_t hval, void *entry_buf, void *value) 
     239                             pj_uint32_t hval, pj_hash_entry_buf entry_buf,  
     240                             void *value) 
    240241{ 
    241242    pj_hash_entry **p_entry; 
    242243 
    243     p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf ); 
     244    p_entry = find_entry( NULL, ht, key, keylen, value, &hval,  
     245                         (void*)entry_buf ); 
    244246    if (*p_entry) { 
    245247        if (value == NULL) { 
Note: See TracChangeset for help on using the changeset viewer.