diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-03-21 14:45:09 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-03-21 14:45:09 +0000 |
commit | 4616bf9d016bcfb319954e52b5d24fc93c3cf1b2 (patch) | |
tree | 985713a4c9ccb003771f04da808fed7d3a74fe93 /src/include/gnunet_common.h | |
parent | 75c121f5ae37d3c7ccd95f4449aea33ccb4200f0 (diff) | |
download | gnunet-4616bf9d016bcfb319954e52b5d24fc93c3cf1b2.tar.gz gnunet-4616bf9d016bcfb319954e52b5d24fc93c3cf1b2.zip |
-idea for improved allocator
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r-- | src/include/gnunet_common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 470069419..29a5f7cfb 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -669,6 +669,15 @@ GNUNET_ntoh_double (double d); | |||
669 | #define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40) | 669 | #define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40) |
670 | 670 | ||
671 | /** | 671 | /** |
672 | * Allocate a struct or union of the given 'type'. | ||
673 | * Wrapper around GNUNET_malloc that returns a pointer | ||
674 | * to the newly created object of the correct type. | ||
675 | * | ||
676 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | ||
677 | */ | ||
678 | #define GNUNET_new(type) (type *) GNUNET_malloc (sizeof (type)) | ||
679 | |||
680 | /** | ||
672 | * Wrapper around malloc. Allocates size bytes of memory. | 681 | * Wrapper around malloc. Allocates size bytes of memory. |
673 | * The memory will be zero'ed out. | 682 | * The memory will be zero'ed out. |
674 | * | 683 | * |