Ignore:
Timestamp:
May 28, 2007 11:49:46 AM (17 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/include/pj/hash.h

    r1054 r1307  
    4848 * This indicates the size of of each hash entry. 
    4949 */ 
    50 #define PJ_HASH_ENTRY_SIZE      (3*sizeof(void*) + 2*sizeof(pj_uint32_t)) 
     50#define PJ_HASH_ENTRY_BUF_SIZE  (3*sizeof(void*) + 2*sizeof(pj_uint32_t)) 
     51 
     52/** 
     53 * Type declaration for entry buffer, used by #pj_hash_set_np() 
     54 */ 
     55typedef void *pj_hash_entry_buf[(PJ_HASH_ENTRY_BUF_SIZE+sizeof(void*)-1)/(sizeof(void*))]; 
    5156 
    5257/** 
     
    149154 *                  compute the key. This value can be obtained when calling 
    150155 *                  #pj_hash_get(). 
    151  * @param entry_buf Pointer to buffer which will be used for the new entry, 
    152  *                  when one needs to be created. The buffer must be at least 
    153  *                  PJ_HASH_ENTRY_SIZE long, and the first PJ_HASH_ENTRY_SIZE 
    154  *                  bytes of the buffer will be used by the hash table. 
    155  *                  Application may use the remaining portion of the buffer 
    156  *                  for its own purpose. 
     156 * @param entry_buf Buffer which will be used for the new entry, when one needs 
     157 *                  to be created. 
    157158 * @param value     value to be associated, or NULL to delete the entry with 
    158159 *                  the specified key. 
     
    160161PJ_DECL(void) pj_hash_set_np(pj_hash_table_t *ht, 
    161162                             const void *key, unsigned keylen,  
    162                              pj_uint32_t hval, void *entry_buf, void *value); 
     163                             pj_uint32_t hval, pj_hash_entry_buf entry_buf,  
     164                             void *value); 
    163165 
    164166/** 
Note: See TracChangeset for help on using the changeset viewer.