Lines Matching refs:len
34 ZEND_API zend_ulong ZEND_FASTCALL zend_hash_func(const char *str, size_t len);
61 #define ZSTR_LEN(zstr) (zstr)->len in END_EXTERN_C()
71 #define STR_ALLOCA_INIT(str, s, len, use_heap) ZSTR_ALLOCA_INIT(str, s, len, use_heap) in END_EXTERN_C() argument
84 #define _ZSTR_STRUCT_SIZE(len) (_ZSTR_HEADER_SIZE + len + 1) in END_EXTERN_C() argument
97 #define ZSTR_ALLOCA_INIT(str, s, len, use_heap) do { \ argument
98 ZSTR_ALLOCA_ALLOC(str, len, use_heap); \
99 memcpy(ZSTR_VAL(str), (s), (len)); \
100 ZSTR_VAL(str)[(len)] = '\0'; \
142 static zend_always_inline zend_string *zend_string_alloc(size_t len, bool persistent) in zend_string_alloc() argument
144 …zend_string *ret = (zend_string *)pemalloc(ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persisten… in zend_string_alloc()
149 ZSTR_LEN(ret) = len; in zend_string_alloc()
164 static zend_always_inline zend_string *zend_string_init(const char *str, size_t len, bool persisten… in zend_string_init() argument
166 zend_string *ret = zend_string_alloc(len, persistent); in zend_string_init()
168 memcpy(ZSTR_VAL(ret), str, len); in zend_string_init()
169 ZSTR_VAL(ret)[len] = '\0'; in zend_string_init()
173 static zend_always_inline zend_string *zend_string_init_fast(const char *str, size_t len) in zend_string_init_fast() argument
175 if (len > 1) { in zend_string_init_fast()
176 return zend_string_init(str, len, 0); in zend_string_init_fast()
177 } else if (len == 0) { in zend_string_init_fast()
214 static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_t len, bool persist… in zend_string_realloc() argument
220 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_realloc()
221 ZSTR_LEN(ret) = len; in zend_string_realloc()
226 ret = zend_string_alloc(len, persistent); in zend_string_realloc()
227 memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN(len, ZSTR_LEN(s)) + 1); in zend_string_realloc()
234 static zend_always_inline zend_string *zend_string_extend(zend_string *s, size_t len, bool persiste… in zend_string_extend() argument
238 ZEND_ASSERT(len >= ZSTR_LEN(s)); in zend_string_extend()
241 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_extend()
242 ZSTR_LEN(ret) = len; in zend_string_extend()
247 ret = zend_string_alloc(len, persistent); in zend_string_extend()
255 static zend_always_inline zend_string *zend_string_truncate(zend_string *s, size_t len, bool persis… in zend_string_truncate() argument
259 ZEND_ASSERT(len <= ZSTR_LEN(s)); in zend_string_truncate()
262 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_truncate()
263 ZSTR_LEN(ret) = len; in zend_string_truncate()
268 ret = zend_string_alloc(len, persistent); in zend_string_truncate()
269 memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), len + 1); in zend_string_truncate()
399 static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len) in zend_inline_hash_func() argument
405 for (; len >= 8; len -= 8, str += 8) { in zend_inline_hash_func()
439 if (len >= 4) { in zend_inline_hash_func()
446 len -= 4; in zend_inline_hash_func()
449 if (len >= 2) { in zend_inline_hash_func()
450 if (len > 2) { in zend_inline_hash_func()
462 } else if (len != 0) { in zend_inline_hash_func()
467 for (; len >= 8; len -= 8) { in zend_inline_hash_func()
477 switch (len) { in zend_inline_hash_func()