From 378f6afccddc03a1044370cbe28875ca055feaeb Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Wed, 26 Mar 2014 16:40:32 +0900 Subject: [PATCH] Mapped std::stirng to STR instead of BIN for benchmark. --- src/msgpack/type/string.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/msgpack/type/string.hpp b/src/msgpack/type/string.hpp index d072d861..62161f44 100644 --- a/src/msgpack/type/string.hpp +++ b/src/msgpack/type/string.hpp @@ -43,25 +43,25 @@ inline std::string& operator>> (object const& o, std::string& v) template inline packer& operator<< (packer& o, const std::string& v) { - o.pack_bin(v.size()); - o.pack_bin_body(v.data(), v.size()); + o.pack_str(v.size()); + o.pack_str_body(v.data(), v.size()); return o; } inline void operator<< (object::with_zone& o, const std::string& v) { - o.type = type::BIN; + o.type = type::STR; char* ptr = (char*)o.zone->allocate_align(v.size()); - o.via.bin.ptr = ptr; - o.via.bin.size = (uint32_t)v.size(); + o.via.str.ptr = ptr; + o.via.str.size = (uint32_t)v.size(); memcpy(ptr, v.data(), v.size()); } inline void operator<< (object& o, const std::string& v) { - o.type = type::BIN; - o.via.bin.ptr = v.data(); - o.via.bin.size = (uint32_t)v.size(); + o.type = type::STR; + o.via.str.ptr = v.data(); + o.via.str.size = (uint32_t)v.size(); }