From ff822f5d81f310bdac1ace1bf7bc6e094e3f1109 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 5 Mar 2018 21:26:43 +0300 Subject: [PATCH] Modified comment [#CLICKHOUSE-2] --- dbms/src/Common/COWPtr.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbms/src/Common/COWPtr.h b/dbms/src/Common/COWPtr.h index 7dde3045f37..9f7cf21ad63 100644 --- a/dbms/src/Common/COWPtr.h +++ b/dbms/src/Common/COWPtr.h @@ -66,6 +66,12 @@ * In contrast, COWPtr is intended for the cases when you need to share states of large objects, * (when you usually will use std::shared_ptr) but you also want precise control over modification * of this shared state. + * + * Caveats: + * - after a call to 'mutate' method, you can still have a reference to immutable ptr somewhere + * and it can still become shared. Also it would be better to make 'mutate' method rvalue-qualified. + * - as 'mutable_ptr' should be unique, it's refcount is redundant - probably it would be better + * to use std::unique_ptr for it, but see above. */ template class COWPtr : public boost::intrusive_ref_counter