Lines Matching refs:intern
406 spl_heap_object *intern = spl_heap_from_obj(object); in spl_heap_object_free_storage() local
408 zend_object_std_dtor(&intern->std); in spl_heap_object_free_storage()
410 spl_ptr_heap_destroy(intern->heap); in spl_heap_object_free_storage()
416 spl_heap_object *intern; in spl_heap_object_new_ex() local
420 intern = zend_object_alloc(sizeof(spl_heap_object), parent); in spl_heap_object_new_ex()
422 zend_object_std_init(&intern->std, class_type); in spl_heap_object_new_ex()
423 object_properties_init(&intern->std, class_type); in spl_heap_object_new_ex()
427 intern->std.handlers = other->std.handlers; in spl_heap_object_new_ex()
430 intern->heap = spl_ptr_heap_clone(other->heap); in spl_heap_object_new_ex()
432 intern->heap = other->heap; in spl_heap_object_new_ex()
435 intern->flags = other->flags; in spl_heap_object_new_ex()
436 intern->fptr_cmp = other->fptr_cmp; in spl_heap_object_new_ex()
437 intern->fptr_count = other->fptr_count; in spl_heap_object_new_ex()
438 return &intern->std; in spl_heap_object_new_ex()
443 …intern->heap = spl_ptr_heap_init(spl_ptr_pqueue_elem_cmp, spl_ptr_heap_pqueue_elem_ctor, spl_ptr_h… in spl_heap_object_new_ex()
444 intern->std.handlers = &spl_handler_SplPriorityQueue; in spl_heap_object_new_ex()
445 intern->flags = SPL_PQUEUE_EXTR_DATA; in spl_heap_object_new_ex()
451 intern->heap = spl_ptr_heap_init( in spl_heap_object_new_ex()
454 intern->std.handlers = &spl_handler_SplHeap; in spl_heap_object_new_ex()
465 …intern->fptr_cmp = zend_hash_str_find_ptr(&class_type->function_table, "compare", sizeof("compare"… in spl_heap_object_new_ex()
466 if (intern->fptr_cmp->common.scope == parent) { in spl_heap_object_new_ex()
467 intern->fptr_cmp = NULL; in spl_heap_object_new_ex()
469 …intern->fptr_count = zend_hash_str_find_ptr(&class_type->function_table, "count", sizeof("count") … in spl_heap_object_new_ex()
470 if (intern->fptr_count->common.scope == parent) { in spl_heap_object_new_ex()
471 intern->fptr_count = NULL; in spl_heap_object_new_ex()
475 return &intern->std; in spl_heap_object_new_ex()
497 spl_heap_object *intern = spl_heap_from_obj(object); in spl_heap_object_count_elements() local
499 if (intern->fptr_count) { in spl_heap_object_count_elements()
501 zend_call_method_with_0_params(object, intern->std.ce, &intern->fptr_count, "count", &rv); in spl_heap_object_count_elements()
511 *count = spl_ptr_heap_count(intern->heap); in spl_heap_object_count_elements()
518 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_heap_object_get_debug_info() local
524 if (!intern->std.properties) { in spl_heap_object_get_debug_info()
525 rebuild_object_properties(&intern->std); in spl_heap_object_get_debug_info()
528 debug_info = zend_new_array(zend_hash_num_elements(intern->std.properties) + 1); in spl_heap_object_get_debug_info()
529 zend_hash_copy(debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref); in spl_heap_object_get_debug_info()
532 ZVAL_LONG(&tmp, intern->flags); in spl_heap_object_get_debug_info()
537 ZVAL_BOOL(&tmp, intern->heap->flags&SPL_HEAP_CORRUPTED); in spl_heap_object_get_debug_info()
543 for (i = 0; i < intern->heap->count; ++i) { in spl_heap_object_get_debug_info()
545 spl_pqueue_elem *pq_elem = spl_heap_elem(intern->heap, i); in spl_heap_object_get_debug_info()
550 zval *elem = spl_heap_elem(intern->heap, i); in spl_heap_object_get_debug_info()
566 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_heap_object_get_gc() local
567 *gc_data = (zval *) intern->heap->elements; in spl_heap_object_get_gc()
568 *gc_data_count = intern->heap->count; in spl_heap_object_get_gc()
576 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_pqueue_object_get_gc() local
577 *gc_data = (zval *) intern->heap->elements; in spl_pqueue_object_get_gc()
579 *gc_data_count = 2 * intern->heap->count; in spl_pqueue_object_get_gc()
589 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
595 count = spl_ptr_heap_count(intern->heap); in PHP_METHOD()
603 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
609 RETURN_BOOL(spl_ptr_heap_count(intern->heap) == 0); in PHP_METHOD()
613 static zend_result spl_heap_consistency_validations(const spl_heap_object *intern, bool write) in spl_heap_consistency_validations() argument
615 if (intern->heap->flags & SPL_HEAP_CORRUPTED) { in spl_heap_consistency_validations()
620 if (write && (intern->heap->flags & SPL_HEAP_WRITE_LOCKED)) { in spl_heap_consistency_validations()
632 spl_heap_object *intern; in PHP_METHOD() local
638 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
640 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
645 spl_ptr_heap_insert(intern->heap, value, ZEND_THIS); in PHP_METHOD()
654 spl_heap_object *intern; in PHP_METHOD() local
660 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
662 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
666 if (spl_ptr_heap_delete_top(intern->heap, return_value, ZEND_THIS) == FAILURE) { in PHP_METHOD()
677 spl_heap_object *intern; in PHP_METHOD() local
685 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
687 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
696 if (!intern->fptr_cmp) { in PHP_METHOD()
702 if (intern->heap->count == 0) { /* Specialize empty queue */ in PHP_METHOD()
703 intern->heap->cmp = new_cmp; in PHP_METHOD()
704 } else if (new_cmp != intern->heap->cmp) { /* Despecialize on type conflict. */ in PHP_METHOD()
705 intern->heap->cmp = spl_ptr_pqueue_elem_cmp; in PHP_METHOD()
709 spl_ptr_heap_insert(intern->heap, &elem, ZEND_THIS); in PHP_METHOD()
719 spl_heap_object *intern; in PHP_METHOD() local
725 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
727 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
731 if (spl_ptr_heap_delete_top(intern->heap, &elem, ZEND_THIS) == FAILURE) { in PHP_METHOD()
736 spl_pqueue_extract_helper(return_value, &elem, intern->flags); in PHP_METHOD()
744 spl_heap_object *intern; in PHP_METHOD() local
751 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
753 if (UNEXPECTED(spl_heap_consistency_validations(intern, false) != SUCCESS)) { in PHP_METHOD()
757 elem = spl_ptr_heap_top(intern->heap); in PHP_METHOD()
764 spl_pqueue_extract_helper(return_value, elem, intern->flags); in PHP_METHOD()
773 spl_heap_object *intern; in PHP_METHOD() local
785 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
786 intern->flags = value; in PHP_METHOD()
787 RETURN_LONG(intern->flags); in PHP_METHOD()
794 spl_heap_object *intern; in PHP_METHOD() local
800 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
802 RETURN_LONG(intern->flags); in PHP_METHOD()
809 spl_heap_object *intern; in PHP_METHOD() local
815 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
817 intern->heap->flags = intern->heap->flags & ~SPL_HEAP_CORRUPTED; in PHP_METHOD()
826 spl_heap_object *intern; in PHP_METHOD() local
832 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
834 RETURN_BOOL(intern->heap->flags & SPL_HEAP_CORRUPTED); in PHP_METHOD()
855 spl_heap_object *intern; in PHP_METHOD() local
861 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
863 if (UNEXPECTED(spl_heap_consistency_validations(intern, false) != SUCCESS)) { in PHP_METHOD()
867 value = spl_ptr_heap_top(intern->heap); in PHP_METHOD()
984 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
990 RETURN_LONG(intern->heap->count - 1); in PHP_METHOD()
997 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1003 spl_ptr_heap_delete_top(intern->heap, NULL, ZEND_THIS); in PHP_METHOD()
1010 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1016 RETURN_BOOL(intern->heap->count != 0); in PHP_METHOD()
1033 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1039 if (!intern->heap->count) { in PHP_METHOD()
1042 zval *element = spl_heap_elem(intern->heap, 0); in PHP_METHOD()
1051 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1057 if (!intern->heap->count) { in PHP_METHOD()
1060 spl_pqueue_elem *elem = spl_heap_elem(intern->heap, 0); in PHP_METHOD()
1061 spl_pqueue_extract_helper(return_value, elem, intern->flags); in PHP_METHOD()