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


Ignore:
Timestamp:
2014-11-11T17:10:13Z (5 years ago)
Author:
Xuefer
Message:

use vector for objects/object_handles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/foot.m4

    r1566 r1567  
    136136    if (src->objects_count) {
    137137        zend_uint i;
    138         processor.object_handles = emalloc(sizeof(*processor.object_handles) * src->objects_count);
     138        xc_vector_init(zend_object_handle, &processor.object_handles);
     139        xc_vector_reserve(&processor.object_handles, src->objects_count);
    139140        for (i = 0; i < src->objects_count; ++i) {
    140141            zend_object *object = emalloc(sizeof(*object));
    141             processor.object_handles[i] = zend_objects_store_put(object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC);
     142            xc_vector_data(zend_object_handle, &processor.object_handles)[i] = zend_objects_store_put(object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC);
    142143            xc_restore_zend_object(&processor, object, &src->objects[i] TSRMLS_CC);
    143144        }
     
    153154        zend_uint i;
    154155        for (i = 0; i < src->objects_count; ++i) {
    155             zend_objects_store_del_ref_by_handle(processor.object_handles[i] TSRMLS_CC);
     156            zend_objects_store_del_ref_by_handle(xc_vector_data(zend_object_handle, &processor.object_handles)[i] TSRMLS_CC);
    156157        }
    157         efree(processor.object_handles);
     158        xc_vector_destroy(&processor.object_handles);
    158159    }
    159160#endif
Note: See TracChangeset for help on using the changeset viewer.