message: finish fastPack pack merge
diff: @@ -28,13 +28,11 @@ static void* swoole_unserialize_object(void *buffer, zval *return_value, zend_uc
  static PHP_METHOD(swoole_serialize, pack);
  -static PHP_METHOD(swoole_serialize, fastPack);
  static PHP_METHOD(swoole_serialize, unpack);
  static const zend_function_entry swoole_serialize_methods[] = {
  PHP_ME(swoole_serialize, pack, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
  - PHP_ME(swoole_serialize, fastPack, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
  PHP_ME(swoole_serialize, unpack, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
  PHP_FE_END
  };
  @@ -50,6 +48,8 @@ void swoole_serialize_init(int module_number TSRMLS_DC)
  ZVAL_STRING(&swSeriaG.sleep_fname, "__sleep");
  ZVAL_STRING(&swSeriaG.weekup_fname, "__weekup");
  +
  + REGISTER_LONG_CONSTANT("SWOOLE_FAST_PACK", SW_FAST_PACK, CONST_CS | CONST_PERSISTENT);
  }
  static CPINLINE int swoole_string_new(size_t size, seriaString *str, zend_uchar type)
  @@ -1163,12 +1163,13 @@ void php_swoole_unserialize(void * buffer, size_t len, zval *return_value, zval
  static PHP_METHOD(swoole_serialize, pack)
  {
  zval *zvalue;
  + zend_size_t is_fast = 0;
  - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zvalue) == FAILURE)
  + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &zvalue, &is_fast) == FAILURE)
  {
  RETURN_FALSE;
  }
  - swSeriaG.pack_string = 1;
  + swSeriaG.pack_string = !is_fast;
  zend_string *z_str = php_swoole_serialize(zvalue);
  RETURN_STR(z_str);
  @@ -1176,19 +1177,6 @@ static PHP_METHOD(swoole_serialize, pack)
  }
  -static PHP_METHOD(swoole_serialize, fastPack)
  -{
  - zval *zvalue;
  -
  - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zvalue) == FAILURE)
  - {
  - RETURN_FALSE;
  - }
  - swSeriaG.pack_string = 0;
  - zend_string *z_str = php_swoole_serialize(zvalue);
  -
  - RETURN_STR(z_str);
  -}
  static PHP_METHOD(swoole_serialize, unpack)
  {
  