]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
bytecode_ptr updates
authorJustin Viiret <justin.viiret@intel.com>
Tue, 4 Apr 2017 00:51:09 +0000 (10:51 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:19:36 +0000 (15:19 +1000)
src/util/bytecode_ptr.h

index 1242e23d6e86fd7ebccb17ea9c53556722fea6e6..713649abc0cb25a879c3fe66b63d132a74a4e129 100644 (file)
@@ -28,7 +28,8 @@
 
 /**
  * \file
- * \brief bytecode_ptr: Smart pointer that knows its length and alignment.
+ * \brief bytecode_ptr: Smart pointer with unique ownership that knows its
+ * length and alignment.
  */
 
 #ifndef UTIL_BYTECODE_PTR_H
 namespace ue2 {
 
 /**
- * \brief Smart pointer that knows its length and alignment.
+ * \brief Smart pointer that knows its length and alignment and behaves like a
+ * std::unique_ptr -- i.e. it retains unique ownership of the memory region.
  *
  * This is intended to be used for flat aligned memory regions that will
  * eventually end up copied into the Hyperscan bytecode.
  */
-template<typename T> class bytecode_ptr : totally_ordered<bytecode_ptr<T>> {
+template<typename T>
+class bytecode_ptr : totally_ordered<bytecode_ptr<T>> {
 public:
     bytecode_ptr() = default;
     explicit bytecode_ptr(size_t size, size_t align = alignof(T))
@@ -65,7 +68,7 @@ public:
 
     bytecode_ptr(std::nullptr_t) {}
 
-    T *get() const { return ptr.get(); };
+    T *get() const { return ptr.get(); }
 
     T &operator*() { return *ptr; }
     const T &operator*() const { return *ptr; }