mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
This commit is contained in:
parent
8cce5b2641
commit
4a2e40bb86
169 changed files with 3285 additions and 3175 deletions
|
@ -597,11 +597,11 @@ char * _mysqlnd_pestrdup(const char * const ptr, zend_bool persistent MYSQLND_ME
|
|||
smart_str_appendc(&tmp_str, *p);
|
||||
} while (*p++);
|
||||
|
||||
ret = (persistent) ? __zend_malloc(tmp_str.s->len + sizeof(size_t)) : _emalloc(REAL_SIZE(tmp_str.s->len + sizeof(size_t)) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
memcpy(FAKE_PTR(ret), tmp_str.s->val, tmp_str.s->len);
|
||||
ret = (persistent) ? __zend_malloc(ZSTR_LEN(tmp_str.s) + sizeof(size_t)) : _emalloc(REAL_SIZE(ZSTR_LEN(tmp_str.s) + sizeof(size_t)) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
memcpy(FAKE_PTR(ret), ZSTR_VAL(tmp_str.s), ZSTR_LEN(tmp_str.s));
|
||||
|
||||
if (ret && collect_memory_statistics) {
|
||||
*(size_t *) ret = tmp_str.s->len;
|
||||
*(size_t *) ret = ZSTR_LEN(tmp_str.s);
|
||||
MYSQLND_INC_GLOBAL_STATISTIC(persistent? STAT_MEM_STRDUP_COUNT : STAT_MEM_ESTRDUP_COUNT);
|
||||
}
|
||||
smart_str_free(&tmp_str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue