Lines Matching refs:len
37 ZEND_API zend_ulong ZEND_FASTCALL zend_hash_func(const char *str, size_t len);
67 #define ZSTR_LEN(zstr) (zstr)->len in END_EXTERN_C()
77 #define STR_ALLOCA_INIT(str, s, len, use_heap) ZSTR_ALLOCA_INIT(str, s, len, use_heap) in END_EXTERN_C() argument
90 #define _ZSTR_STRUCT_SIZE(len) (_ZSTR_HEADER_SIZE + len + 1) in END_EXTERN_C() argument
103 #define ZSTR_ALLOCA_INIT(str, s, len, use_heap) do { \ argument
104 ZSTR_ALLOCA_ALLOC(str, len, use_heap); \
105 memcpy(ZSTR_VAL(str), (s), (len)); \
106 ZSTR_VAL(str)[(len)] = '\0'; \
150 static zend_always_inline zend_string *zend_string_alloc(size_t len, bool persistent) in zend_string_alloc() argument
152 …zend_string *ret = (zend_string *)pemalloc(ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persisten… in zend_string_alloc()
157 ZSTR_LEN(ret) = len; in zend_string_alloc()
172 static zend_always_inline zend_string *zend_string_init(const char *str, size_t len, bool persisten… in zend_string_init() argument
174 zend_string *ret = zend_string_alloc(len, persistent); in zend_string_init()
176 memcpy(ZSTR_VAL(ret), str, len); in zend_string_init()
177 ZSTR_VAL(ret)[len] = '\0'; in zend_string_init()
181 static zend_always_inline zend_string *zend_string_init_fast(const char *str, size_t len) in zend_string_init_fast() argument
183 if (len > 1) { in zend_string_init_fast()
184 return zend_string_init(str, len, 0); in zend_string_init_fast()
185 } else if (len == 0) { in zend_string_init_fast()
222 static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_t len, bool persist… in zend_string_realloc() argument
228 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_realloc()
229 ZSTR_LEN(ret) = len; in zend_string_realloc()
234 ret = zend_string_alloc(len, persistent); in zend_string_realloc()
235 memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN(len, ZSTR_LEN(s)) + 1); in zend_string_realloc()
242 static zend_always_inline zend_string *zend_string_extend(zend_string *s, size_t len, bool persiste… in zend_string_extend() argument
246 ZEND_ASSERT(len >= ZSTR_LEN(s)); in zend_string_extend()
249 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_extend()
250 ZSTR_LEN(ret) = len; in zend_string_extend()
255 ret = zend_string_alloc(len, persistent); in zend_string_extend()
263 static zend_always_inline zend_string *zend_string_truncate(zend_string *s, size_t len, bool persis… in zend_string_truncate() argument
267 ZEND_ASSERT(len <= ZSTR_LEN(s)); in zend_string_truncate()
270 ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); in zend_string_truncate()
271 ZSTR_LEN(ret) = len; in zend_string_truncate()
276 ret = zend_string_alloc(len, persistent); in zend_string_truncate()
277 memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), len + 1); in zend_string_truncate()
425 static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len) in zend_inline_hash_func() argument
431 for (; len >= 8; len -= 8, str += 8) { in zend_inline_hash_func()
465 if (len >= 4) { in zend_inline_hash_func()
472 len -= 4; in zend_inline_hash_func()
475 if (len >= 2) { in zend_inline_hash_func()
476 if (len > 2) { in zend_inline_hash_func()
488 } else if (len != 0) { in zend_inline_hash_func()
493 for (; len >= 8; len -= 8) { in zend_inline_hash_func()
503 switch (len) { in zend_inline_hash_func()