From 035cbf9f3cdab032eefd088c2cad3d2bdaab11c3 Mon Sep 17 00:00:00 2001 From: Alliballibaba Date: Sun, 19 Oct 2025 00:49:35 +0200 Subject: [PATCH] Removes unused code. --- types.c | 21 --------------------- types.go | 4 ++++ types.h | 9 --------- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/types.c b/types.c index a52f451e..27cbdae2 100644 --- a/types.c +++ b/types.c @@ -15,27 +15,11 @@ Bucket *get_ht_bucket(HashTable *ht) { return NULL; } -void *__emalloc__(size_t size) { return emalloc(size); } - void __zend_hash_init__(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent) { zend_hash_init(ht, nSize, NULL, pDestructor, persistent); } -void __zval_null__(zval *zv) { ZVAL_NULL(zv); } - -void __zval_bool__(zval *zv, bool val) { ZVAL_BOOL(zv, val); } - -void __zval_long__(zval *zv, zend_long val) { ZVAL_LONG(zv, val); } - -void __zval_double__(zval *zv, double val) { ZVAL_DOUBLE(zv, val); } - -void __zval_string__(zval *zv, zend_string *str) { ZVAL_STR(zv, str); } - -void __zval_empty_string__(zval *zv) { ZVAL_EMPTY_STRING(zv); } - -void __zval_arr__(zval *zv, zend_array *arr) { ZVAL_ARR(zv, arr); } - zend_array *__zend_new_array__(uint32_t size) { return zend_new_array(size); } bool is_internal_class(zend_class_entry *entry) { @@ -79,11 +63,6 @@ void __zval_unserialize__(zval *retval, zend_string *str) { zend_string_release(str); } -zval *__init_zval__() { - zval *zv = (zval *)emalloc(sizeof(zval)); - return zv; -} - zend_object *__php_object_init__( zval *zv, const char *class_name, diff --git a/types.go b/types.go index c866115e..00584391 100644 --- a/types.go +++ b/types.go @@ -3,6 +3,10 @@ package frankenphp /* #cgo nocallback __zend_new_array__ #cgo noescape __zend_new_array__ +#cgo nocallback zend_hash_str_update +#cgo noescape zend_hash_str_update +#cgo nocallback zend_hash_next_index_insert +#cgo noescape zend_hash_next_index_insert #include "types.h" */ import "C" diff --git a/types.h b/types.h index 193e3640..e994fa17 100644 --- a/types.h +++ b/types.h @@ -10,23 +10,14 @@ zval *get_ht_packed_data(HashTable *, uint32_t index); Bucket *get_ht_bucket(HashTable *); -void *__emalloc__(size_t size); void __zend_hash_init__(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent); -void __zval_null__(zval *zv); -void __zval_bool__(zval *zv, bool val); -void __zval_long__(zval *zv, zend_long val); -void __zval_double__(zval *zv, double val); -void __zval_string__(zval *zv, zend_string *str); -void __zval_empty_string__(zval *zv); -void __zval_arr__(zval *zv, zend_array *arr); zend_array *__zend_new_array__(uint32_t size); bool is_internal_class(zend_class_entry *entry); zend_string *__zval_serialize__(zend_object *obj); void __zval_unserialize__(zval *retval, zend_string *str); -zval *__init_zval__(); zend_object *__php_object_init__( zval *zv, const char *class_name,