You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/17 12:51:33 UTC

[GitHub] [arrow] zzzzwj commented on a diff in pull request #33703: GH-14748:[C++] Modify some comments about shared_ptr's ownership in parquet-cpp.

zzzzwj commented on code in PR #33703:
URL: https://github.com/apache/arrow/pull/33703#discussion_r1072169620


##########
cpp/src/parquet/arrow/test_util.h:
##########
@@ -463,12 +463,16 @@ Status MakeEmptyListsArray(int64_t size, std::shared_ptr<Array>* out_array) {
   return Status::OK();
 }
 
+// Please make sure that the return value should have an object assigned explicitly
+// if you want to use the pointer contained.

Review Comment:
   Hi pitrou. I think I misunderstood the meaning of [emkornfield](https://github.com/emkornfield). According to https://github.com/apache/arrow/issues/14748#issuecomment-1333336429, I thought that when a function returns a shared_ptr containing a new object (the pointer contained is allocated in the function), then it need to add the comment "sth. must not outlive some object". This function is static, which belongs to no object. So, I put my word to replace that comment. And you can refer to #14748, I open that issue because I directly used the bare pointer without explicitly assignment to an object, and it causes the access violation.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org