Parcourir la source

[2088] Add comments about size argument to deallocate()

Mukund Sivaraman il y a 12 ans
Parent
commit
59c5e16d4f
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      src/lib/util/memory_segment.h

+ 5 - 1
src/lib/util/memory_segment.h

@@ -44,7 +44,11 @@ public:
     /// \brief Free/release a segment of memory.
     ///
     /// This method may throw <code>isc::OutOfRange</code> if \c size is
-    /// not equal to the originally allocated size.
+    /// not equal to the originally allocated size. \c size could be
+    /// used by some implementations such as a slice allocator, where
+    /// freeing memory also requires the size to be specified. We also
+    /// use this argument in some implementations to test if all allocated
+    /// memory was deallocated properly.
     ///
     /// \param ptr Pointer to the block of memory to free/release. This
     /// should be equal to a value returned by <code>allocate()</code>.