[ https://issues.apache.org/jira/browse/GEODE-10098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501602#comment-17501602 ]
ASF GitHub Bot commented on GEODE-10098: ---------------------------------------- pivotal-jbarrett commented on a change in pull request #943: URL: https://github.com/apache/geode-native/pull/943#discussion_r820000276 ########## File path: cppcache/src/util/make_unique.hpp ########## @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UTIL_MAKE_UNIQUE_H +#define UTIL_MAKE_UNIQUE_H + +#include <cstddef> +#include <memory> +#include <type_traits> +#include <utility> + +// N3656 standard revision of make_unique. + Review comment: There is an internal shared library, that used go be static linked into the main library, but is still linked into all the test libraries. It was intended to be a place to put common utils that both the main lib and test code could use without exporting them as symbols from the main lib. It is the perfect place to consolidate `make_unique` for both the main lib and tests. The two files currently in this library are obsolete and should be deleted. It would also need to be added back as a library dependency to `_apache-geode` library. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > TcrConnection::readMessage should not be explicitly allocating memory > --------------------------------------------------------------------- > > Key: GEODE-10098 > URL: https://issues.apache.org/jira/browse/GEODE-10098 > Project: Geode > Issue Type: Improvement > Components: native client > Reporter: Blake Bender > Priority: Major > Labels: pull-request-available > > This method calls new to read an array of bytes, then returns it to the > caller, whose responsibility is to delete it (what the heck???). Even > better, the memory is deleted in a call to TcrMessage::setData, so not even > in the same class. If this memory was a std::vector<int8_t>, we could > probably take advantage of move semantics and maybe even improve performance > a bit, in addition to avoiding potential leaks and weirdness... -- This message was sent by Atlassian Jira (v8.20.1#820001)