Changeset 1567 in svn for trunk/processor/var-helper.h


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/var-helper.h

    r1566 r1567  
    44    size_t next_index;
    55
    6     if (!xc_vector_initialized(&processor->objects)) {
    7         xc_vector_init(zend_object, &processor->objects);
     6    if (!xc_vector_initialized(&processor->object_handles)) {
     7        xc_vector_init(zend_object, &processor->object_handles);
    88        zend_hash_init(&processor->handle_to_index, 0, NULL, NULL, 0);
    99    }
    1010
    11     next_index = xc_vector_size(&processor->objects);
     11    next_index = xc_vector_size(&processor->object_handles);
    1212    if (_zend_hash_index_update_or_next_insert(&processor->handle_to_index, handle, (void *) &next_index, sizeof(next_index), NULL, HASH_ADD ZEND_FILE_LINE_CC) == SUCCESS) {
    1313        zend_object *object = zend_object_store_get_object_by_handle(handle TSRMLS_CC);
    14         xc_vector_push_back(&processor->objects, object);
     14        xc_vector_push_back(&processor->object_handles, object);
    1515    }
    1616}
     
    2121
    2222    if (zend_hash_index_find(&processor->handle_to_index, handle, (void **) &index) != SUCCESS) {
    23         php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Internal error: handle %d not found in objects", handle);
     23        php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Internal error: handle %d not found on store", handle);
    2424        return (size_t) -1;
    2525    }
     
    3030static zend_object_handle xc_var_restore_handle(xc_processor_t *processor, size_t index TSRMLS_DC) /* {{{ */
    3131{
    32     zend_object_handle handle = processor->object_handles[index];
     32    zend_object_handle handle = xc_vector_data(zend_object_handle, &processor->object_handles)[index];
    3333    zend_objects_store_add_ref_by_handle(handle TSRMLS_CC);
    3434    return handle;
Note: See TracChangeset for help on using the changeset viewer.