Browse Source

relocate: fix ifrelocate()

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1474 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 8 years ago
parent
commit
7c5c7c2161
  1. 9
      processor/hashtable.m4
  2. 4
      processor/main.m4
  3. 4
      processor/struct.m4

9
processor/hashtable.m4

@ -47,12 +47,11 @@ define(`DEF_HASH_TABLE_FUNC', `DEF_STRUCT_P_FUNC(`HashTable', `$1', `
', ` dnl IFDASM else
dnl }}}
Bucket *srcBucket;
IFRELOCATE(`Bucket *next;')
IFCOPY(`Bucket *first = NULL, *last = NULL;')
IFRELOCATE(`Bucket *dstBucket = NULL;')
IFCOPY(`Bucket *dstBucket = NULL, *first = NULL, *last = NULL;')
dnl only used for copy
IFCOPY(`uint n;')
IFRESTORE(`Bucket *dstBucket = NULL;')
IFRELOCATE(`uint n;')
IFRESTORE(`uint n;')
IFCALCCOPY(`size_t bucketSize;')
#if defined(HARDENING_PATCH_HASH_PROTECT) && HARDENING_PATCH_HASH_PROTECT
@ -147,7 +146,7 @@ define(`DEF_HASH_TABLE_FUNC', `DEF_STRUCT_P_FUNC(`HashTable', `$1', `
IFRELOCATE(`
for (n = 0; n < SRC(`nTableSize'); ++n) {
if (SRC(`arBuckets[n]')) {
next = PTR_FROM_VIRTUAL_EX(`Bucket', `DST(`arBuckets[n]')');
Bucket *next = PTR_FROM_VIRTUAL_EX(`Bucket', `DST(`arBuckets[n]')');
do {
dstBucket = next;
next = PTR_FROM_VIRTUAL_EX(`Bucket', `next->pNext');

4
processor/main.m4

@ -241,8 +241,8 @@ define(`IFCALCSTORE', `IFSTORE(`$1', `IFCALC(`$1', `$2')')')
define(`IFRESTORE', `ifelse(PROCESSOR_TYPE, `restore', `$1', `$2')')
define(`IFCOPY', `IFSTORE(`$1', `IFRESTORE(`$1', `$2')')')
define(`IFCALCCOPY', `IFCALC(`$1', `IFCOPY(`$1', `$2')')')
define(`IFRELOCATE', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')')
define(`IFRELOCATE', `IFSTORE(`$1', `IFRELOCATE(`$1', `$2')')')
define(`IFRELOCATEONLY', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')')
define(`IFRELOCATE', `IFSTORE(`$1', `IFRELOCATEONLY(`$1', `$2')')')
define(`IFDPRINT', `ifelse(PROCESSOR_TYPE, `dprint', `$1', `$2')')
define(`IFDASM', `ifelse(PROCESSOR_TYPE, `dasm', `$1', `$2')')
dnl }}}

4
processor/struct.m4

@ -14,7 +14,7 @@ define(`DECL_STRUCT_P_FUNC', `translit(
IFCALC( `xc_processor_t *processor, const $1 * const src')
IFSTORE( `xc_processor_t *processor, $1 *dst, const $1 * const src')
IFRESTORE(`xc_processor_t *processor, $1 *dst, const $1 * const src')
IFRELOCATE(`$1 *const dst, ptrdiff_t ptrdiff, ptrdiff_t relocatediff')
IFRELOCATEONLY(`$1 *const dst, ptrdiff_t ptrdiff, ptrdiff_t relocatediff')
IFDASM(`xc_dasm_t *dasm, zval *dst, const $1 * const src')
TSRMLS_DC
)ifelse(`$3', `', `;')
@ -147,7 +147,7 @@ ifdef(`DASM_STRUCT_DIRECT', `', `
IFCALC( `processor, $6 $3')
IFSTORE( `processor, $6 $2, $6 $3')
IFRESTORE(`processor, $6 $2, $6 $3')
IFRELOCATE(`
IFRELOCATEONLY(`
ifelse(`$6', `', `PTR_FROM_VIRTUAL_EX(`$1', `$3')', `$6 $3')
, ptrdiff
, relocatediff

Loading…
Cancel
Save