blob: 87bb44b0f59c6c3c90357bcd6e00f3f32c86ce33 [file] [log] [blame]
Harald Welte41b85d52015-08-31 08:56:53 +02001--- ../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 Weltefa034002010-07-18 23:15:24 +02003@@ -15,6 +15,8 @@
4 #include <assert.h> /* for assert() macro */
5 #endif
6
Harald Welte41b85d52015-08-31 08:56:53 +02007+#include <osmocom/core/talloc.h>
Harald Weltefa034002010-07-18 23:15:24 +02008+
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
Harald Welte41b85d52015-08-31 08:56:53 +020012@@ -23,10 +25,12 @@
13 #define ASN1C_ENVIRONMENT_VERSION 924 /* Compile-time version */
Harald Weltefa034002010-07-18 23:15:24 +020014 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 Welte6264d3d2010-07-18 23:30:11 +020022+#define CALLOC(nmemb, size) talloc_zero_size(talloc_asn1_ctx, (nmemb) * (size))
Harald Weltefa034002010-07-18 23:15:24 +020023+#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 Welte41b85d52015-08-31 08:56:53 +020027 #define asn_debug_indent 0
28 #define ASN_DEBUG_INDENT_ADD(i) do{}while(0)