mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
Get rid of memchr
This commit is contained in:
parent
81dd2af465
commit
00596b414e
1 changed files with 12 additions and 3 deletions
|
@ -407,7 +407,13 @@ PS_SERIALIZER_DECODE_FUNC(php)
|
||||||
|
|
||||||
PHP_VAR_UNSERIALIZE_INIT(var_hash);
|
PHP_VAR_UNSERIALIZE_INIT(var_hash);
|
||||||
|
|
||||||
for (p = q = val; (p < endptr) && (q = memchr(p, PS_DELIMITER, endptr - p)); p = q) {
|
p = val;
|
||||||
|
|
||||||
|
while (p < endptr) {
|
||||||
|
q = p;
|
||||||
|
while (*q != PS_DELIMITER)
|
||||||
|
if (++q >= endptr) goto break_outer_loop;
|
||||||
|
|
||||||
if (p[0] == PS_UNDEF_MARKER) {
|
if (p[0] == PS_UNDEF_MARKER) {
|
||||||
p++;
|
p++;
|
||||||
has_value = 0;
|
has_value = 0;
|
||||||
|
@ -428,8 +434,11 @@ PS_SERIALIZER_DECODE_FUNC(php)
|
||||||
}
|
}
|
||||||
PS_ADD_VARL(name, namelen);
|
PS_ADD_VARL(name, namelen);
|
||||||
efree(name);
|
efree(name);
|
||||||
|
|
||||||
|
p = q;
|
||||||
}
|
}
|
||||||
|
break_outer_loop:
|
||||||
|
|
||||||
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
@ -911,7 +920,7 @@ static void php_session_start(PSLS_D)
|
||||||
int nrdels = -1;
|
int nrdels = -1;
|
||||||
|
|
||||||
nrand = (int) (100.0*php_combined_lcg());
|
nrand = (int) (100.0*php_combined_lcg());
|
||||||
if (nrand <= PS(gc_probability)) {
|
if (nrand < PS(gc_probability)) {
|
||||||
PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels);
|
PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels);
|
||||||
#if 0
|
#if 0
|
||||||
if (nrdels != -1)
|
if (nrdels != -1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue