Lines Matching refs:intern
409 spl_heap_object *intern = spl_heap_from_obj(object); in spl_heap_object_free_storage() local
411 zend_object_std_dtor(&intern->std); in spl_heap_object_free_storage()
413 spl_ptr_heap_destroy(intern->heap); in spl_heap_object_free_storage()
419 spl_heap_object *intern; in spl_heap_object_new_ex() local
423 intern = zend_object_alloc(sizeof(spl_heap_object), parent); in spl_heap_object_new_ex()
425 zend_object_std_init(&intern->std, class_type); in spl_heap_object_new_ex()
426 object_properties_init(&intern->std, class_type); in spl_heap_object_new_ex()
430 intern->std.handlers = other->std.handlers; in spl_heap_object_new_ex()
433 intern->heap = spl_ptr_heap_clone(other->heap); in spl_heap_object_new_ex()
435 intern->heap = other->heap; in spl_heap_object_new_ex()
438 intern->flags = other->flags; in spl_heap_object_new_ex()
439 intern->fptr_cmp = other->fptr_cmp; in spl_heap_object_new_ex()
440 intern->fptr_count = other->fptr_count; in spl_heap_object_new_ex()
441 return &intern->std; in spl_heap_object_new_ex()
446 …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()
447 intern->flags = SPL_PQUEUE_EXTR_DATA; in spl_heap_object_new_ex()
453 intern->heap = spl_ptr_heap_init( in spl_heap_object_new_ex()
466 …intern->fptr_cmp = zend_hash_str_find_ptr(&class_type->function_table, "compare", sizeof("compare"… in spl_heap_object_new_ex()
467 if (intern->fptr_cmp->common.scope == parent) { in spl_heap_object_new_ex()
468 intern->fptr_cmp = NULL; in spl_heap_object_new_ex()
471 intern->fptr_count = zend_hash_find_ptr(&class_type->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); in spl_heap_object_new_ex()
472 if (intern->fptr_count->common.scope == parent) { in spl_heap_object_new_ex()
473 intern->fptr_count = NULL; in spl_heap_object_new_ex()
477 return &intern->std; in spl_heap_object_new_ex()
499 spl_heap_object *intern = spl_heap_from_obj(object); in spl_heap_object_count_elements() local
501 if (intern->fptr_count) { in spl_heap_object_count_elements()
503 zend_call_method_with_0_params(object, intern->std.ce, &intern->fptr_count, "count", &rv); in spl_heap_object_count_elements()
513 *count = spl_ptr_heap_count(intern->heap); in spl_heap_object_count_elements()
520 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_heap_object_get_debug_info() local
523 HashTable *properties = zend_std_get_properties_ex(&intern->std); in spl_heap_object_get_debug_info()
529 ZVAL_LONG(&tmp, intern->flags); in spl_heap_object_get_debug_info()
532 ZVAL_BOOL(&tmp, intern->heap->flags&SPL_HEAP_CORRUPTED); in spl_heap_object_get_debug_info()
537 for (zend_ulong i = 0; i < intern->heap->count; ++i) { in spl_heap_object_get_debug_info()
539 spl_pqueue_elem *pq_elem = spl_heap_elem(intern->heap, i); in spl_heap_object_get_debug_info()
544 zval *elem = spl_heap_elem(intern->heap, i); in spl_heap_object_get_debug_info()
558 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_heap_object_get_gc() local
559 *gc_data = (zval *) intern->heap->elements; in spl_heap_object_get_gc()
560 *gc_data_count = intern->heap->count; in spl_heap_object_get_gc()
568 spl_heap_object *intern = spl_heap_from_obj(obj); in spl_pqueue_object_get_gc() local
569 *gc_data = (zval *) intern->heap->elements; in spl_pqueue_object_get_gc()
571 *gc_data_count = 2 * intern->heap->count; in spl_pqueue_object_get_gc()
581 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
587 count = spl_ptr_heap_count(intern->heap); in PHP_METHOD()
595 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
601 RETURN_BOOL(spl_ptr_heap_count(intern->heap) == 0); in PHP_METHOD()
605 static zend_result spl_heap_consistency_validations(const spl_heap_object *intern, bool write) in spl_heap_consistency_validations() argument
607 if (intern->heap->flags & SPL_HEAP_CORRUPTED) { in spl_heap_consistency_validations()
612 if (write && (intern->heap->flags & SPL_HEAP_WRITE_LOCKED)) { in spl_heap_consistency_validations()
624 spl_heap_object *intern; in PHP_METHOD() local
630 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
632 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
637 spl_ptr_heap_insert(intern->heap, value, ZEND_THIS); in PHP_METHOD()
646 spl_heap_object *intern; in PHP_METHOD() local
652 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
654 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
658 if (spl_ptr_heap_delete_top(intern->heap, return_value, ZEND_THIS) == FAILURE) { in PHP_METHOD()
669 spl_heap_object *intern; in PHP_METHOD() local
677 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
679 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
688 if (!intern->fptr_cmp) { in PHP_METHOD()
694 if (intern->heap->count == 0) { /* Specialize empty queue */ in PHP_METHOD()
695 intern->heap->cmp = new_cmp; in PHP_METHOD()
696 } else if (new_cmp != intern->heap->cmp) { /* Despecialize on type conflict. */ in PHP_METHOD()
697 intern->heap->cmp = spl_ptr_pqueue_elem_cmp; in PHP_METHOD()
701 spl_ptr_heap_insert(intern->heap, &elem, ZEND_THIS); in PHP_METHOD()
711 spl_heap_object *intern; in PHP_METHOD() local
717 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
719 if (UNEXPECTED(spl_heap_consistency_validations(intern, true) != SUCCESS)) { in PHP_METHOD()
723 if (spl_ptr_heap_delete_top(intern->heap, &elem, ZEND_THIS) == FAILURE) { in PHP_METHOD()
728 spl_pqueue_extract_helper(return_value, &elem, intern->flags); in PHP_METHOD()
736 spl_heap_object *intern; in PHP_METHOD() local
743 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
745 if (UNEXPECTED(spl_heap_consistency_validations(intern, false) != SUCCESS)) { in PHP_METHOD()
749 elem = spl_ptr_heap_top(intern->heap); in PHP_METHOD()
756 spl_pqueue_extract_helper(return_value, elem, intern->flags); in PHP_METHOD()
765 spl_heap_object *intern; in PHP_METHOD() local
777 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
778 intern->flags = value; in PHP_METHOD()
779 RETURN_LONG(intern->flags); in PHP_METHOD()
786 spl_heap_object *intern; in PHP_METHOD() local
792 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
794 RETURN_LONG(intern->flags); in PHP_METHOD()
801 spl_heap_object *intern; in PHP_METHOD() local
807 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
809 intern->heap->flags = intern->heap->flags & ~SPL_HEAP_CORRUPTED; in PHP_METHOD()
818 spl_heap_object *intern; in PHP_METHOD() local
824 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
826 RETURN_BOOL(intern->heap->flags & SPL_HEAP_CORRUPTED); in PHP_METHOD()
847 spl_heap_object *intern; in PHP_METHOD() local
853 intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD()
855 if (UNEXPECTED(spl_heap_consistency_validations(intern, false) != SUCCESS)) { in PHP_METHOD()
859 value = spl_ptr_heap_top(intern->heap); in PHP_METHOD()
976 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
982 RETURN_LONG(intern->heap->count - 1); in PHP_METHOD()
989 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
995 spl_ptr_heap_delete_top(intern->heap, NULL, ZEND_THIS); in PHP_METHOD()
1002 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1008 RETURN_BOOL(intern->heap->count != 0); in PHP_METHOD()
1025 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1031 if (!intern->heap->count) { in PHP_METHOD()
1034 zval *element = spl_heap_elem(intern->heap, 0); in PHP_METHOD()
1043 spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); in PHP_METHOD() local
1049 if (!intern->heap->count) { in PHP_METHOD()
1052 spl_pqueue_elem *elem = spl_heap_elem(intern->heap, 0); in PHP_METHOD()
1053 spl_pqueue_extract_helper(return_value, elem, intern->flags); in PHP_METHOD()