Changeset 1470 in svn for trunk/processor/foot.m4


Ignore:
Timestamp:
2013-11-12T11:08:17+01:00 (21 months ago)
Author:
Xuefer
Message:

processor: abstract store target (storage)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/foot.m4

    r1468 r1470  
     1dnl {{{ xc_store_target
     2EXPORT(`typedef void *(*xc_processor_storage_allocator_t)(void *data, size_t size);')
     3EXPORT(`typedef struct { xc_processor_storage_allocator_t allocator; void *allocator_data; ptrdiff_t relocatediff; } xc_processor_storage_t;')
     4dnl }}}
    15define(`DEFINE_STORE_API', `
    2 EXPORTED_FUNCTION(`$1 *xc_processor_store_$1(ptrdiff_t relocatediff, xc_allocator_t *allocator, $1 *src TSRMLS_DC)') dnl {{{
     6EXPORTED_FUNCTION(`$1 *xc_processor_store_$1(const xc_processor_storage_t *storage, $1 *src TSRMLS_DC)') dnl {{{
    37{
    48    $1 *dst;
     
    711    memset(&processor, 0, sizeof(processor));
    812    processor.handle_reference = 1;
    9     processor.relocatediff = relocatediff;
     13    processor.relocatediff = storage->relocatediff;
    1014
    1115    IFAUTOCHECK(`xc_stack_init(&processor.allocsizes);')
     
    4549
    4650        /* allocator :) */
    47         processor.p = (char *) allocator->vtable->malloc(allocator, processor.size);
     51        processor.p = (char *) storage->allocator(storage->allocator_data, processor.size);
    4852        if (processor.p == NULL) {
    4953            dst = NULL;
Note: See TracChangeset for help on using the changeset viewer.