[Bf-blender-cvs] [b39ddcd6289] functions: add some comments

Jacques Lucke noreply at git.blender.org
Thu Sep 5 19:11:53 CEST 2019


Commit: b39ddcd628975b50c192f7be53049bf81c5d4676
Author: Jacques Lucke
Date:   Thu Sep 5 12:43:53 2019 +0200
Branches: functions
https://developer.blender.org/rBb39ddcd628975b50c192f7be53049bf81c5d4676

add some comments

===================================================================

M	source/blender/blenlib/BLI_allocator.hpp

===================================================================

diff --git a/source/blender/blenlib/BLI_allocator.hpp b/source/blender/blenlib/BLI_allocator.hpp
index 24b9c779942..77506aa3dc5 100644
--- a/source/blender/blenlib/BLI_allocator.hpp
+++ b/source/blender/blenlib/BLI_allocator.hpp
@@ -39,6 +39,10 @@
 
 namespace BLI {
 
+/**
+ * Use Blenders guarded allocator (aka MEM_malloc). This should always be used except there is a
+ * good reason not to use it.
+ */
 class GuardedAllocator {
  public:
   void *allocate(uint size, const char *name)
@@ -58,6 +62,10 @@ class GuardedAllocator {
   }
 };
 
+/**
+ * This is a simple wrapper around malloc/free. Only use this when the GuardedAllocator cannot be
+ * used. This can be the case when the allocated element might live longer than Blenders Allocator.
+ */
 class RawAllocator {
  private:
   struct MemHead {
@@ -93,6 +101,9 @@ class RawAllocator {
   }
 };
 
+/**
+ * Use this only under specific circumstances as described in BLI_temporary_allocator.h.
+ */
 class TemporaryAllocator {
  public:
   void *allocate(uint size, const char *UNUSED(name))



More information about the Bf-blender-cvs mailing list