Skip to content
Permalink
Browse files

Free two bits in fn_flags by merging ZEND_ACC_HEAP_RT_CACHE/ZEND_ACC_…

…USER_ARG_INFO and ZEND_ACC_DONE_PASS_TWO/ZEND_ACC_ARENA_ALLOCATED that may be used only for user/internal functions
  • Loading branch information...
dstogov committed Sep 2, 2019
1 parent e6d3a21 commit c739023a50876e2a90588f915803b0140a95638e
Showing with 9 additions and 7 deletions.
  1. +2 −1 Zend/zend_closures.c
  2. +5 −4 Zend/zend_compile.h
  3. +1 −1 Zend/zend_extensions.h
  4. +1 −1 Zend/zend_modules.h
@@ -183,7 +183,8 @@ ZEND_METHOD(Closure, call)
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
/* copied upon generator creation */
GC_DELREF(&closure->std);
} else if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
} else if (ZEND_USER_CODE(my_function.type)
&& fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
}
}
@@ -278,7 +278,7 @@ typedef struct _zend_oparray_context {
/* Class has unresolved variance obligations. | | | */
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
/* | | | */
/* Function Flags | | | */
/* Function Flags (unused: 23, 26) | | | */
/* ============== | | | */
/* | | | */
/* deprecation flag | | | */
@@ -318,15 +318,16 @@ typedef struct _zend_oparray_context {
/* run_time_cache allocated on heap (user only) | | | */
#define ZEND_ACC_HEAP_RT_CACHE (1 << 22) /* | X | | */
/* | | | */
/* method flag used by Closure::__invoke() | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 23) /* | X | | */
/* method flag used by Closure::__invoke() (int only) | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 22) /* | X | | */
/* | | | */
#define ZEND_ACC_GENERATOR (1 << 24) /* | X | | */
/* | | | */
/* function was processed by pass two (user only) | | | */
#define ZEND_ACC_DONE_PASS_TWO (1 << 25) /* | X | | */
/* | | | */
/* internal function is allocated at arena (int only) | | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 26) /* | X | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */
/* | | | */
/* op_array is a clone of trait method | | | */
#define ZEND_ACC_TRAIT_CLONE (1 << 27) /* | X | | */
@@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi

/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no.. */
#define ZEND_EXTENSION_API_NO 320190529
#define ZEND_EXTENSION_API_NO 320190902

This comment has been minimized.

Copy link
@derickr

derickr Sep 2, 2019

Contributor

@dstogov Should we update main/php.h:#define PHP_API_VERSION 20190529 too? We usually keep that in sync with the ZEND_MODULE_API_NO

This comment has been minimized.

Copy link
@dstogov

dstogov Sep 2, 2019

Author Member

@derickr done


typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -31,7 +31,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module

#define ZEND_MODULE_API_NO 20190529
#define ZEND_MODULE_API_NO 20190902
#ifdef ZTS
#define USING_ZTS 1
#else

0 comments on commit c739023

Please sign in to comment.
You can’t perform that action at this time.