Skip to content

Commit c739023

Browse files
committed
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
1 parent e6d3a21 commit c739023

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Zend/zend_closures.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ ZEND_METHOD(Closure, call)
183183
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
184184
/* copied upon generator creation */
185185
GC_DELREF(&closure->std);
186-
} else if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
186+
} else if (ZEND_USER_CODE(my_function.type)
187+
&& fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
187188
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
188189
}
189190
}

Zend/zend_compile.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ typedef struct _zend_oparray_context {
278278
/* Class has unresolved variance obligations. | | | */
279279
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
280280
/* | | | */
281-
/* Function Flags | | | */
281+
/* Function Flags (unused: 23, 26) | | | */
282282
/* ============== | | | */
283283
/* | | | */
284284
/* deprecation flag | | | */
@@ -318,15 +318,16 @@ typedef struct _zend_oparray_context {
318318
/* run_time_cache allocated on heap (user only) | | | */
319319
#define ZEND_ACC_HEAP_RT_CACHE (1 << 22) /* | X | | */
320320
/* | | | */
321-
/* method flag used by Closure::__invoke() | | | */
322-
#define ZEND_ACC_USER_ARG_INFO (1 << 23) /* | X | | */
321+
/* method flag used by Closure::__invoke() (int only) | | | */
322+
#define ZEND_ACC_USER_ARG_INFO (1 << 22) /* | X | | */
323323
/* | | | */
324324
#define ZEND_ACC_GENERATOR (1 << 24) /* | X | | */
325325
/* | | | */
326+
/* function was processed by pass two (user only) | | | */
326327
#define ZEND_ACC_DONE_PASS_TWO (1 << 25) /* | X | | */
327328
/* | | | */
328329
/* internal function is allocated at arena (int only) | | | */
329-
#define ZEND_ACC_ARENA_ALLOCATED (1 << 26) /* | X | | */
330+
#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */
330331
/* | | | */
331332
/* op_array is a clone of trait method | | | */
332333
#define ZEND_ACC_TRAIT_CLONE (1 << 27) /* | X | | */

Zend/zend_extensions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi
4444

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

4949
typedef struct _zend_extension_version_info {
5050
int zend_extension_api_no;

Zend/zend_modules.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
3232
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
3333

34-
#define ZEND_MODULE_API_NO 20190529
34+
#define ZEND_MODULE_API_NO 20190902
3535
#ifdef ZTS
3636
#define USING_ZTS 1
3737
#else

0 commit comments

Comments
 (0)