From e01a89b9f4ba35ddefb1113be22452368c0e0a0b Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Tue, 9 Jul 2013 04:17:25 +0300 Subject: [PATCH 1/2] DCE --- ext/kernel/memory.h | 4 ---- ext/kernel/string.c | 2 +- ext/kernel/variables.c | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) mode change 100755 => 100644 ext/kernel/memory.h diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h old mode 100755 new mode 100644 index a3dcd8e8a5a..ef910d5612d --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -54,10 +54,6 @@ extern void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); #define PHALCON_ALLOC_ZVAL(z) \ ALLOC_ZVAL(z); INIT_PZVAL(z); ZVAL_NULL(z); -#define PHALCON_INIT_VAR_OLD(z) \ - PHALCON_ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); - #define PHALCON_INIT_VAR(z) \ phalcon_memory_alloc(&z TSRMLS_CC); diff --git a/ext/kernel/string.c b/ext/kernel/string.c index 4eb68e8ad28..5dd650e413c 100644 --- a/ext/kernel/string.c +++ b/ext/kernel/string.c @@ -1095,7 +1095,7 @@ zval *phalcon_eol(int eol TSRMLS_DC) { if (eol) { ZVAL_STRING(local_eol, PHP_EOL, 1); } else { - ZVAL_STRING(local_eol, "", 1); + ZVAL_EMPTY_STRING(local_eol); } return local_eol; diff --git a/ext/kernel/variables.c b/ext/kernel/variables.c index ecd0c9584b1..72601e9b914 100644 --- a/ext/kernel/variables.c +++ b/ext/kernel/variables.c @@ -35,10 +35,6 @@ void phalcon_serialize(zval *return_value, zval **var TSRMLS_DC) { php_serialize_data_t var_hash; smart_str buf = {0}; - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - PHP_VAR_SERIALIZE_INIT(var_hash); php_var_serialize(&buf, var, &var_hash TSRMLS_CC); PHP_VAR_SERIALIZE_DESTROY(var_hash); From 101a6894d739b15801b765eeb4bcf678fee7cf1f Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Tue, 9 Jul 2013 04:17:25 +0300 Subject: [PATCH 2/2] DCE --- ext/kernel/memory.h | 4 ---- ext/kernel/string.c | 2 +- ext/kernel/variables.c | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) mode change 100755 => 100644 ext/kernel/memory.h diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h old mode 100755 new mode 100644 index de785ef7cca..e5e41f2a693 --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -54,10 +54,6 @@ extern void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin); #define PHALCON_ALLOC_ZVAL(z) \ ALLOC_ZVAL(z); INIT_PZVAL(z); ZVAL_NULL(z); -#define PHALCON_INIT_VAR_OLD(z) \ - PHALCON_ALLOC_ZVAL(z); \ - phalcon_memory_observe(&z TSRMLS_CC); - #define PHALCON_INIT_VAR(z) \ phalcon_memory_alloc(&z TSRMLS_CC); diff --git a/ext/kernel/string.c b/ext/kernel/string.c index 4eb68e8ad28..5dd650e413c 100644 --- a/ext/kernel/string.c +++ b/ext/kernel/string.c @@ -1095,7 +1095,7 @@ zval *phalcon_eol(int eol TSRMLS_DC) { if (eol) { ZVAL_STRING(local_eol, PHP_EOL, 1); } else { - ZVAL_STRING(local_eol, "", 1); + ZVAL_EMPTY_STRING(local_eol); } return local_eol; diff --git a/ext/kernel/variables.c b/ext/kernel/variables.c index ecd0c9584b1..72601e9b914 100644 --- a/ext/kernel/variables.c +++ b/ext/kernel/variables.c @@ -35,10 +35,6 @@ void phalcon_serialize(zval *return_value, zval **var TSRMLS_DC) { php_serialize_data_t var_hash; smart_str buf = {0}; - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - PHP_VAR_SERIALIZE_INIT(var_hash); php_var_serialize(&buf, var, &var_hash TSRMLS_CC); PHP_VAR_SERIALIZE_DESTROY(var_hash);