From 5653fa55a1af255efc6d752dff3789fea34b99a2 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Tue, 4 Apr 2017 10:51:09 +1000 Subject: [PATCH] bytecode_ptr updates --- src/util/bytecode_ptr.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/util/bytecode_ptr.h b/src/util/bytecode_ptr.h index 1242e23d..713649ab 100644 --- a/src/util/bytecode_ptr.h +++ b/src/util/bytecode_ptr.h @@ -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 @@ -44,12 +45,14 @@ 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 class bytecode_ptr : totally_ordered> { +template +class bytecode_ptr : totally_ordered> { 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; }