You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/02/14 02:27:30 UTC

[GitHub] [incubator-doris] chaoyli opened a new pull request #2899: [gutil] import scoped_refptr smart pointer from KUDU

chaoyli opened a new pull request #2899: [gutil] import scoped_refptr smart pointer from KUDU
URL: https://github.com/apache/incubator-doris/pull/2899
 
 
   scoped_refptr is used to replace std::shared_ptr, is generally faster and smaller.
   advantage
     (1) only requires a single allocation, and ref count is on the same cache line as the object
     (2) the pointer only requires 8 bytes (since the ref count is within the object)
     (3) you can manually increase or decrease reference counts when more control is required
     (4) you can convert from a raw pointer back to a scoped_refptr safely without worrying about double freeing
     (5) since we control the implementation, we can implement features, such as debug builds that capture the stack trace of every referent to help debug leaks.
   disadvantage
     (1) the referred-to object must inherit from RefCounted
     (2) does not support the weak_ptr use cases

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] chaoyli merged pull request #2899: [gutil] import scoped_refptr smart pointer from KUDU

Posted by GitBox <gi...@apache.org>.
chaoyli merged pull request #2899: [gutil] import scoped_refptr smart pointer from KUDU
URL: https://github.com/apache/incubator-doris/pull/2899
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] lingbin commented on issue #2899: [gutil] import scoped_refptr smart pointer from KUDU

Posted by GitBox <gi...@apache.org>.
lingbin commented on issue #2899: [gutil] import scoped_refptr smart pointer from KUDU
URL: https://github.com/apache/incubator-doris/pull/2899#issuecomment-586094212
 
 
   I checked the code of kudu. Almost all tools in `gutil` do not have UT. It may be because these utils have been thoroughly tested(maybe in Chromium project) and because these tool classes have been widely used, so I feel it is ok to import them without UTs.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org