diff options
Diffstat (limited to 'src/alloc')
-rw-r--r-- | src/alloc/alloc_mmap/mmap_mem.h | 5 | ||||
-rw-r--r-- | src/alloc/mem_pool/mem_pool.h | 5 | ||||
-rw-r--r-- | src/alloc/secmem.h | 9 | ||||
-rw-r--r-- | src/alloc/system_alloc/defalloc.h | 5 |
4 files changed, 21 insertions, 3 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h index be1d06cff..521d85ea9 100644 --- a/src/alloc/alloc_mmap/mmap_mem.h +++ b/src/alloc/alloc_mmap/mmap_mem.h @@ -21,7 +21,10 @@ namespace Botan { class MemoryMapping_Allocator : public Pooling_Allocator { public: - MemoryMapping_Allocator(Mutex* m) : Pooling_Allocator(m) {} + /** + * @param mutex used for internal locking + */ + MemoryMapping_Allocator(Mutex* mutex) : Pooling_Allocator(mutex) {} std::string type() const { return "mmap"; } private: void* alloc_block(u32bit); diff --git a/src/alloc/mem_pool/mem_pool.h b/src/alloc/mem_pool/mem_pool.h index 69555544e..a67e641e2 100644 --- a/src/alloc/mem_pool/mem_pool.h +++ b/src/alloc/mem_pool/mem_pool.h @@ -27,7 +27,10 @@ class Pooling_Allocator : public Allocator void destroy(); - Pooling_Allocator(Mutex*); + /** + * @param mutex used for internal locking + */ + Pooling_Allocator(Mutex* mutex); ~Pooling_Allocator(); private: void get_more_core(u32bit); diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h index 39b5549a9..bc5a2499d 100644 --- a/src/alloc/secmem.h +++ b/src/alloc/secmem.h @@ -195,6 +195,11 @@ class MemoryRegion ~MemoryRegion() { deallocate(buf, allocated); } protected: MemoryRegion() { buf = 0; alloc = 0; used = allocated = 0; } + + /** + * Copy constructor + * @param other the other region to copy + */ MemoryRegion(const MemoryRegion<T>& other) { buf = 0; @@ -203,6 +208,10 @@ class MemoryRegion set(other.buf, other.used); } + /** + * @param locking should we use a locking allocator + * @param length the initial length to use + */ void init(bool locking, u32bit length = 0) { alloc = Allocator::get(locking); resize(length); } private: diff --git a/src/alloc/system_alloc/defalloc.h b/src/alloc/system_alloc/defalloc.h index 27ee3cd8f..dcf552b8b 100644 --- a/src/alloc/system_alloc/defalloc.h +++ b/src/alloc/system_alloc/defalloc.h @@ -30,7 +30,10 @@ class Malloc_Allocator : public Allocator class Locking_Allocator : public Pooling_Allocator { public: - Locking_Allocator(Mutex* m) : Pooling_Allocator(m) {} + /** + * @param mutex used for internal locking + */ + Locking_Allocator(Mutex* mutex) : Pooling_Allocator(mutex) {} std::string type() const { return "locking"; } private: |