diff options
Diffstat (limited to 'ace/Malloc_T.h')
-rw-r--r-- | ace/Malloc_T.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ace/Malloc_T.h b/ace/Malloc_T.h index cb208f0ad16..5364a4d7acb 100644 --- a/ace/Malloc_T.h +++ b/ace/Malloc_T.h @@ -84,18 +84,33 @@ public: ~ACE_Cached_Allocator (void); /** - * Get a chunk of memory from free store. Note that <nbytes> is + * Get a chunk of memory from free list cache. Note that <nbytes> is * only checked to make sure that it's <= to sizeof T, and is * otherwise ignored since <malloc> always returns a pointer to an * item of sizeof (T). */ void *malloc (size_t nbytes = sizeof (T)); - /// return a chunk of memory back to free store. + /** + * Get a chunk of memory from free list cache, giving them + * <initial_value>. Note that <nbytes> is only checked to make sure + * that it's <= to sizeof T, and is otherwise ignored since <malloc> + * always returns a pointer to an item of sizeof (T). + */ + virtual void *calloc (size_t nbytes, + char initial_value = '\0'); + + /// This method is a no-op and just returns 0 since the free list + /// only works with fixed sized entities. + virtual void *calloc (size_t n_elem, + size_t elem_size, + char initial_value = '\0'); + + /// Return a chunk of memory back to free list cache. void free (void *); private: - /// remember how we allocate the memory in the first place so + /// Remember how we allocate the memory in the first place so /// we can clear things up later. char *pool_; |