|
23 | 23 | ZEND_API zend_llist zend_extensions; |
24 | 24 | ZEND_API uint32_t zend_extension_flags = 0; |
25 | 25 | ZEND_API int zend_op_array_extension_handles = 0; |
| 26 | +ZEND_API int zend_internal_function_extension_handles = 0; |
26 | 27 | static int last_resource_number; |
27 | 28 |
|
28 | 29 | zend_result zend_load_extension(const char *path) |
@@ -207,6 +208,7 @@ void zend_startup_extensions_mechanism(void) |
207 | 208 | /* Startup extensions mechanism */ |
208 | 209 | zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1); |
209 | 210 | zend_op_array_extension_handles = 0; |
| 211 | + zend_internal_function_extension_handles = 0; |
210 | 212 | last_resource_number = 0; |
211 | 213 | } |
212 | 214 |
|
@@ -301,8 +303,23 @@ ZEND_API int zend_get_op_array_extension_handles(const char *module_name, int ha |
301 | 303 | return handle; |
302 | 304 | } |
303 | 305 |
|
| 306 | +ZEND_API int zend_get_internal_function_extension_handle(const char *module_name) |
| 307 | +{ |
| 308 | + int handle = zend_internal_function_extension_handles++; |
| 309 | + zend_add_system_entropy(module_name, "zend_get_internal_function_extension_handle", &zend_internal_function_extension_handles, sizeof(int)); |
| 310 | + return handle; |
| 311 | +} |
| 312 | + |
| 313 | +ZEND_API int zend_get_internal_function_extension_handles(const char *module_name, int handles) |
| 314 | +{ |
| 315 | + int handle = zend_internal_function_extension_handles; |
| 316 | + zend_internal_function_extension_handles += handles; |
| 317 | + zend_add_system_entropy(module_name, "zend_get_internal_function_extension_handle", &zend_internal_function_extension_handles, sizeof(int)); |
| 318 | + return handle; |
| 319 | +} |
| 320 | + |
304 | 321 | ZEND_API size_t zend_internal_run_time_cache_reserved_size(void) { |
305 | | - return zend_op_array_extension_handles * sizeof(void *); |
| 322 | + return zend_internal_function_extension_handles * sizeof(void *); |
306 | 323 | } |
307 | 324 |
|
308 | 325 | ZEND_API void zend_init_internal_run_time_cache(void) { |
|
0 commit comments