aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-18 23:15:24 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-20 00:05:07 +0200
commitfa034009a11b0ea5f91074e6137e8711240217a6 (patch)
tree43d6fbed6f5301946749e6140600f09bddc6f23a /include
parentec0e217b0647eb798576a7d3366b39c159c00624 (diff)
Convert libasn1c to use talloc from libosmocore
Diffstat (limited to 'include')
-rw-r--r--include/asn1c/asn_internal.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/asn1c/asn_internal.h b/include/asn1c/asn_internal.h
index 249d7ef..47f9930 100644
--- a/include/asn1c/asn_internal.h
+++ b/include/asn1c/asn_internal.h
@@ -15,6 +15,8 @@
#include <assert.h> /* for assert() macro */
#endif
+#include <osmocore/talloc.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -23,10 +25,12 @@ extern "C" {
#define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */
int get_asn1c_environment_version(void); /* Run-time version */
-#define CALLOC(nmemb, size) calloc(nmemb, size)
-#define MALLOC(size) malloc(size)
-#define REALLOC(oldptr, size) realloc(oldptr, size)
-#define FREEMEM(ptr) free(ptr)
+extern void *talloc_asn1_ctx;
+
+#define CALLOC(nmemb, size) talloc_size(talloc_asn1_ctx, (nmemb) * (size))
+#define MALLOC(size) talloc_size(talloc_asn1_ctx, size)
+#define REALLOC(oldptr, size) talloc_realloc_size(talloc_asn1_ctx, oldptr, size)
+#define FREEMEM(ptr) talloc_free(ptr)
/*
* A macro for debugging the ASN.1 internals.