diff options
author | Markus Teich <teichm@fs.tum.de> | 2016-10-09 11:51:12 +0000 |
---|---|---|
committer | Markus Teich <teichm@fs.tum.de> | 2016-10-09 11:51:12 +0000 |
commit | eb876a69e4d34771a7c614fa1355f4e902bd1abe (patch) | |
tree | cba68e08d575ed01b5d7441b4323c617d2e7c45a /src/include/gnunet_common.h | |
parent | c9f2b5e884cac0605dd9f2931c7154fb94baeb84 (diff) | |
download | gnunet-eb876a69e4d34771a7c614fa1355f4e902bd1abe.tar.gz gnunet-eb876a69e4d34771a7c614fa1355f4e902bd1abe.zip |
libgnunetutil: add file, line debug info to multidimensional array allocators
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r-- | src/include/gnunet_common.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index dfe8effcd..dcd0c6056 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -807,7 +807,7 @@ GNUNET_ntoh_double (double d); | |||
807 | * @param m size of the second dimension | 807 | * @param m size of the second dimension |
808 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 808 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
809 | */ | 809 | */ |
810 | #define GNUNET_new_array_2d(n, m, type) (type **) GNUNET_xnew_array_2d_ (n, m, sizeof (type)) | 810 | #define GNUNET_new_array_2d(n, m, type) (type **) GNUNET_xnew_array_2d_ (n, m, sizeof (type), __FILE__, __LINE__) |
811 | 811 | ||
812 | /** | 812 | /** |
813 | * @ingroup memory | 813 | * @ingroup memory |
@@ -819,7 +819,7 @@ GNUNET_ntoh_double (double d); | |||
819 | * @param o size of the third dimension | 819 | * @param o size of the third dimension |
820 | * @param type name of the struct or union, i.e. pass 'struct Foo'. | 820 | * @param type name of the struct or union, i.e. pass 'struct Foo'. |
821 | */ | 821 | */ |
822 | #define GNUNET_new_array_3d(n, m, o, type) (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof (type)) | 822 | #define GNUNET_new_array_3d(n, m, o, type) (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof (type), __FILE__, __LINE__) |
823 | 823 | ||
824 | /** | 824 | /** |
825 | * @ingroup memory | 825 | * @ingroup memory |
@@ -1001,10 +1001,13 @@ GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | |||
1001 | * @param n size of the first dimension | 1001 | * @param n size of the first dimension |
1002 | * @param m size of the second dimension | 1002 | * @param m size of the second dimension |
1003 | * @param elementSize size of a single element in bytes | 1003 | * @param elementSize size of a single element in bytes |
1004 | * @param filename where is this call being made (for debugging) | ||
1005 | * @param linenumber line where this call is being made (for debugging) | ||
1004 | * @return allocated memory, never NULL | 1006 | * @return allocated memory, never NULL |
1005 | */ | 1007 | */ |
1006 | void ** | 1008 | void ** |
1007 | GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize); | 1009 | GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize, |
1010 | const char *filename, int linenumber); | ||
1008 | 1011 | ||
1009 | 1012 | ||
1010 | /** | 1013 | /** |
@@ -1018,10 +1021,13 @@ GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize); | |||
1018 | * @param m size of the second dimension | 1021 | * @param m size of the second dimension |
1019 | * @param o size of the third dimension | 1022 | * @param o size of the third dimension |
1020 | * @param elementSize size of a single element in bytes | 1023 | * @param elementSize size of a single element in bytes |
1024 | * @param filename where is this call being made (for debugging) | ||
1025 | * @param linenumber line where this call is being made (for debugging) | ||
1021 | * @return allocated memory, never NULL | 1026 | * @return allocated memory, never NULL |
1022 | */ | 1027 | */ |
1023 | void *** | 1028 | void *** |
1024 | GNUNET_xnew_array_3d_ (size_t n, size_t m, size_t o, size_t elementSize); | 1029 | GNUNET_xnew_array_3d_ (size_t n, size_t m, size_t o, size_t elementSize, |
1030 | const char *filename, int linenumber); | ||
1025 | 1031 | ||
1026 | 1032 | ||
1027 | /** | 1033 | /** |