Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 1 | --- ../asn1c/skeletons/asn_internal.h 2015-08-31 09:29:45.590924282 +0200 |
| 2 | +++ include/asn1c/asn_internal.h 2015-08-31 09:26:17.461872713 +0200 |
Harald Welte | fa03400 | 2010-07-18 23:15:24 +0200 | [diff] [blame] | 3 | @@ -15,6 +15,8 @@ |
| 4 | #include <assert.h> /* for assert() macro */ |
| 5 | #endif |
| 6 | |
Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 7 | +#include <osmocom/core/talloc.h> |
Harald Welte | fa03400 | 2010-07-18 23:15:24 +0200 | [diff] [blame] | 8 | + |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 12 | @@ -23,10 +25,12 @@ |
| 13 | #define ASN1C_ENVIRONMENT_VERSION 924 /* Compile-time version */ |
Harald Welte | fa03400 | 2010-07-18 23:15:24 +0200 | [diff] [blame] | 14 | int get_asn1c_environment_version(void); /* Run-time version */ |
| 15 | |
| 16 | -#define CALLOC(nmemb, size) calloc(nmemb, size) |
| 17 | -#define MALLOC(size) malloc(size) |
| 18 | -#define REALLOC(oldptr, size) realloc(oldptr, size) |
| 19 | -#define FREEMEM(ptr) free(ptr) |
| 20 | +extern void *talloc_asn1_ctx; |
| 21 | + |
Harald Welte | 6264d3d | 2010-07-18 23:30:11 +0200 | [diff] [blame] | 22 | +#define CALLOC(nmemb, size) talloc_zero_size(talloc_asn1_ctx, (nmemb) * (size)) |
Harald Welte | fa03400 | 2010-07-18 23:15:24 +0200 | [diff] [blame] | 23 | +#define MALLOC(size) talloc_size(talloc_asn1_ctx, size) |
| 24 | +#define REALLOC(oldptr, size) talloc_realloc_size(talloc_asn1_ctx, oldptr, size) |
| 25 | +#define FREEMEM(ptr) talloc_free(ptr) |
| 26 | |
Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 27 | #define asn_debug_indent 0 |
| 28 | #define ASN_DEBUG_INDENT_ADD(i) do{}while(0) |