Unverified Commit 9ab859f5 authored by Ludger Sprenker's avatar Ludger Sprenker Committed by GitHub

Create std::string in Arena memory

parent 80e016e8
......@@ -322,10 +322,8 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr {
void CreateInstance(::google::protobuf::Arena* arena,
const ::std::string* initial_value) {
GOOGLE_DCHECK(initial_value != NULL);
ptr_ = new ::std::string(*initial_value);
if (arena != NULL) {
arena->Own(ptr_);
}
// uses "new ::std::string" when arena is nullptr
ptr_ = Arena::Create<::std::string>(arena, *initial_value);
}
GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
void CreateInstanceNoArena(const ::std::string* initial_value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment