[gjs: 3/4] GjsMaybeOwned: Clarify comment on heap allocation



commit 41b951f4ca1c2f73f222e631e3413cf6ba11cb87
Author: Philip Chimento <philip chimento gmail com>
Date:   Thu Jun 20 19:11:58 2019 +0200

    GjsMaybeOwned: Clarify comment on heap allocation

 gjs/jsapi-util-root.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gjs/jsapi-util-root.h b/gjs/jsapi-util-root.h
index 5cd150ca..e5754198 100644
--- a/gjs/jsapi-util-root.h
+++ b/gjs/jsapi-util-root.h
@@ -109,11 +109,9 @@ struct GjsHeapOperation<JSFunction*> {
     }
 };
 
-/* GjsMaybeOwned is intended only for use in heap allocation. Do not allocate it
- * on the stack, and do not allocate any instances of structures that have it as
- * a member on the stack either. Unfortunately we cannot enforce this at compile
- * time with a private constructor; that would prevent the intended usage as a
- * member of a heap-allocated struct. */
+/* GjsMaybeOwned is intended for use as a member of classes that are allocated
+ * on the heap. Do not allocate GjsMaybeOwned on the stack, and do not allocate
+ * any instances of classes that have it as a member on the stack either. */
 template<typename T>
 class GjsMaybeOwned {
  public:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]