diff options
author | Martin Willi <martin@strongswan.org> | 2005-12-01 07:35:03 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-12-01 07:35:03 +0000 |
commit | d45ec1dedfa06155c344f5cce0ac7b2ec331c825 (patch) | |
tree | de2a74ae64525e4d45c3178ab7d16484297ce1dd /Source/charon/utils/allocator.h | |
parent | 2ef11339c720d06215f44555de020ea5ebdfd641 (diff) | |
download | strongswan-d45ec1dedfa06155c344f5cce0ac7b2ec331c825.tar.bz2 strongswan-d45ec1dedfa06155c344f5cce0ac7b2ec331c825.tar.xz |
- implemented sa_config
- uses identification
- and host
- untested
- ts need further tuning
Diffstat (limited to 'Source/charon/utils/allocator.h')
-rw-r--r-- | Source/charon/utils/allocator.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/charon/utils/allocator.h b/Source/charon/utils/allocator.h index f27610a16..a86311789 100644 --- a/Source/charon/utils/allocator.h +++ b/Source/charon/utils/allocator.h @@ -133,6 +133,22 @@ * - NULL if out of ressources */ void * (*clone_bytes) (allocator_t *this,void * to_clone, size_t bytes, char * file, int line); + + /** + * Clones a chunk with LEAK_DETECTION and returns a cloned chunk. + * + * @warning Use this function not directly, only with assigned macro + * #allocator_clone_chunk- + * + * @param this allocator_t object + * @param chunk chunk to clone + * @param file filename from which the memory is allocated + * @param line line number in specific file + * @return + * - pointer to reallocated memory area if successful + * - NULL if out of ressources + */ + chunk_t (*clone_chunk) (allocator_t *this, chunk_t chunk, char * file, int line); /** * Frees memory with LEAK_DETECTION. @@ -201,6 +217,16 @@ */ #define allocator_clone_bytes(old,bytes) (global_allocator->clone_bytes(global_allocator,old,bytes,__FILE__, __LINE__)) + + /** + * Macro to clone a chunk and its contents + * + * See #allocator_t.clone_chunk for description. + * + * @ingroup utils + */ + #define allocator_clone_chunk(chunk) (global_allocator->clone_chunk(global_allocator,chunk,__FILE__, __LINE__)) + /** * Macro to free some memory. * @@ -266,6 +292,17 @@ void * allocator_clone_bytes(void * pointer, size_t size); /** + * Clone a chunk and its contents. + * + * + * @param chunk chunk to clone + * @return cloned chunk + * + * @ingroup utils + */ + chunk_t allocator_clone_bytes(chunk_t chunk); + + /** * Frees memory used by chunk. * * @param chunk pointer of chunk to free |