changed htb.c to help align the value pointer on a word boundary
This commit is contained in:
parent
f3f5d38fc6
commit
8093f20372
@ -66,7 +66,7 @@ QSE_INLINE pair_t* qse_htb_allocpair (
|
|||||||
vcop = htb->style->copier[QSE_HTB_VAL];
|
vcop = htb->style->copier[QSE_HTB_VAL];
|
||||||
|
|
||||||
as = SIZEOF(pair_t);
|
as = SIZEOF(pair_t);
|
||||||
if (kcop == QSE_HTB_COPIER_INLINE) as += KTOB(htb,klen);
|
if (kcop == QSE_HTB_COPIER_INLINE) as += QSE_ALIGNTO_POW2(KTOB(htb,klen), QSE_SIZEOF_VOID_P);
|
||||||
if (vcop == QSE_HTB_COPIER_INLINE) as += VTOB(htb,vlen);
|
if (vcop == QSE_HTB_COPIER_INLINE) as += VTOB(htb,vlen);
|
||||||
|
|
||||||
n = (pair_t*) QSE_MMGR_ALLOC (htb->mmgr, as);
|
n = (pair_t*) QSE_MMGR_ALLOC (htb->mmgr, as);
|
||||||
@ -105,7 +105,7 @@ QSE_INLINE pair_t* qse_htb_allocpair (
|
|||||||
{
|
{
|
||||||
VPTR(n) = n + 1;
|
VPTR(n) = n + 1;
|
||||||
if (kcop == QSE_HTB_COPIER_INLINE)
|
if (kcop == QSE_HTB_COPIER_INLINE)
|
||||||
VPTR(n) = (byte_t*)VPTR(n) + KTOB(htb,klen);
|
VPTR(n) = (byte_t*)VPTR(n) + QSE_ALIGNTO_POW2(KTOB(htb,klen), QSE_SIZEOF_VOID_P);
|
||||||
/* if vptr is QSE_NULL, the inline copier does not fill
|
/* if vptr is QSE_NULL, the inline copier does not fill
|
||||||
* the actual value area */
|
* the actual value area */
|
||||||
if (vptr) QSE_MEMCPY (VPTR(n), vptr, VTOB(htb,vlen));
|
if (vptr) QSE_MEMCPY (VPTR(n), vptr, VTOB(htb,vlen));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user