Revert "Zend/zend_types.h: move zend_string to zend_string.h"

This reverts commit 02690fe3c0.
This commit is contained in:
Dmitry Stogov 2023-04-04 09:58:56 +03:00
parent 3528ca8930
commit ac3abe4579
4 changed files with 16 additions and 21 deletions

View file

@ -21,12 +21,12 @@
#ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H
#include "zend_portability.h"
#include "zend_result.h"
#include <stdio.h>
#include "../TSRM/TSRM.h"
#include "zend.h"
#ifndef ZEND_MM_ALIGNMENT
# error "ZEND_MM_ALIGNMENT was not defined during configure"

View file

@ -16,7 +16,6 @@
+----------------------------------------------------------------------+
*/
#include "zend_string.h"
#include "zend.h"
#include "zend_globals.h"
#include "zend_rc_debug.h"

View file

@ -19,26 +19,8 @@
#ifndef ZEND_STRING_H
#define ZEND_STRING_H
#include "zend_alloc.h"
#include "zend.h"
#include "zend_char.h"
#include "zend_portability.h"
#include "zend_refcounted.h"
/* string flags (zval.value->gc.u.flags) */
#define IS_STR_CLASS_NAME_MAP_PTR GC_PROTECTED /* refcount is a map_ptr offset of class_entry */
#define IS_STR_INTERNED GC_IMMUTABLE /* interned string */
#define IS_STR_PERSISTENT GC_PERSISTENT /* allocated using malloc */
#define IS_STR_PERMANENT (1<<8) /* relives request boundary */
#define IS_STR_VALID_UTF8 (1<<9) /* valid UTF-8 according to PCRE */
typedef struct _zend_string zend_string;
struct _zend_string {
zend_refcounted_h gc;
zend_ulong h; /* hash value */
size_t len;
char val[1];
};
BEGIN_EXTERN_C()

View file

@ -331,6 +331,13 @@ struct _zval_struct {
} u2;
};
struct _zend_string {
zend_refcounted_h gc;
zend_ulong h; /* hash value */
size_t len;
char val[1];
};
typedef struct _Bucket {
zval val;
zend_ulong h; /* hash value (or numeric index) */
@ -620,6 +627,13 @@ static zend_always_inline uint8_t zval_get_type(const zval* pz) {
#define IS_CONSTANT_AST_EX (IS_CONSTANT_AST | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT))
/* string flags (zval.value->gc.u.flags) */
#define IS_STR_CLASS_NAME_MAP_PTR GC_PROTECTED /* refcount is a map_ptr offset of class_entry */
#define IS_STR_INTERNED GC_IMMUTABLE /* interned string */
#define IS_STR_PERSISTENT GC_PERSISTENT /* allocated using malloc */
#define IS_STR_PERMANENT (1<<8) /* relives request boundary */
#define IS_STR_VALID_UTF8 (1<<9) /* valid UTF-8 according to PCRE */
/* array flags */
#define IS_ARRAY_IMMUTABLE GC_IMMUTABLE
#define IS_ARRAY_PERSISTENT GC_PERSISTENT