@@ -92,7 +92,6 @@ doc/html.tar
src/crc*gen.c
include/osmocom/core/crc*gen.h
include/osmocom/core/bit*gen.h
-/include/osmocom/core/talloc.h
# vi files
*.sw?
@@ -82,26 +82,7 @@ CHECK_TM_INCLUDES_TM_GMTOFF
dnl Generate the output
AC_CONFIG_HEADER(config.h)
-AC_ARG_ENABLE([internal-talloc],
- [AS_HELP_STRING(
- [--enable-internal-talloc],
- [Disable using bundled talloc memory allocator]
- )],
- [internal_talloc=$enableval], [internal_talloc="no"])
-AM_CONDITIONAL([INTERNAL_TALLOC], [test x"$internal_talloc" = x"yes"])
-AS_IF([test x"$internal_talloc" = xno],
- [
- PKG_CHECK_MODULES([TALLOC], [talloc])
- OSMOCORE_INTERNAL_TALLOC=0
- ],
- [
- TALLOC_CFLAGS=""
- TALLOC_LIBS=""
- OSMOCORE_INTERNAL_TALLOC=1
- AC_SUBST([TALLOC_CFLAGS])
- AC_SUBST([TALLOC_LIBS])
- ])
-AC_SUBST([OSMOCORE_INTERNAL_TALLOC])
+PKG_CHECK_MODULES([TALLOC], [talloc])
AC_ARG_ENABLE(plugin,
[AS_HELP_STRING(
@@ -186,7 +167,6 @@ then
AM_CONDITIONAL(ENABLE_MSGFILE, false)
AM_CONDITIONAL(ENABLE_SERIAL, false)
AM_CONDITIONAL(ENABLE_VTY, false)
- AM_CONDITIONAL([INTERNAL_TALLOC], [true])
AM_CONDITIONAL(ENABLE_UTILITIES, false)
AM_CONDITIONAL(ENABLE_GB, false)
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
@@ -201,7 +181,6 @@ AC_OUTPUT(
libosmogb.pc
libosmoctrl.pc
include/Makefile
- include/osmocom/core/talloc.h
src/Makefile
src/vty/Makefile
src/codec/Makefile
@@ -89,11 +89,6 @@ if ENABLE_PLUGIN
nobase_include_HEADERS += osmocom/core/plugin.h
endif
-nobase_nodist_include_HEADERS = osmocom/core/talloc.h
-if INTERNAL_TALLOC
-nobase_include_HEADERS += osmocom/core/talloc_int.h
-endif
-
if ENABLE_MSGFILE
nobase_include_HEADERS += osmocom/core/msgfile.h
endif
@@ -31,7 +31,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
/*! \brief A structure representing an osmocom string ringbuffer */
deleted file mode 100644
@@ -1,6 +0,0 @@
-#pragma once
-#if @OSMOCORE_INTERNAL_TALLOC@
-#include <osmocom/core/talloc_int.h>
-#else
-#include <talloc.h>
-#endif
deleted file mode 100644
@@ -1,189 +0,0 @@
-#pragma once
-/*
- Unix SMB/CIFS implementation.
- Samba temporary memory allocation functions
-
- Copyright (C) Andrew Tridgell 2004-2005
- Copyright (C) Stefan Metzmacher 2006
-
- ** NOTE! The following LGPL license applies to the talloc
- ** library. This does NOT imply that all of Samba is released
- ** under the LGPL
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 3 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#define HAVE_VA_COPY
-
-/* this is only needed for compatibility with the old talloc */
-typedef void TALLOC_CTX;
-
-/*
- this uses a little trick to allow __LINE__ to be stringified
-*/
-#ifndef __location__
-#define __TALLOC_STRING_LINE1__(s) #s
-#define __TALLOC_STRING_LINE2__(s) __TALLOC_STRING_LINE1__(s)
-#define __TALLOC_STRING_LINE3__ __TALLOC_STRING_LINE2__(__LINE__)
-#define __location__ __FILE__ ":" __TALLOC_STRING_LINE3__
-#endif
-
-#ifndef TALLOC_DEPRECATED
-#define TALLOC_DEPRECATED 0
-#endif
-
-#ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
-/** Use gcc attribute to check printf fns. a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
-/* try to make talloc_set_destructor() and talloc_steal() type safe,
- if we have a recent gcc */
-#if (__GNUC__ >= 3)
-#define _TALLOC_TYPEOF(ptr) __typeof__(ptr)
-#define talloc_set_destructor(ptr, function) \
- do { \
- int (*_talloc_destructor_fn)(_TALLOC_TYPEOF(ptr)) = (function); \
- _talloc_set_destructor((ptr), (int (*)(void *))_talloc_destructor_fn); \
- } while(0)
-/* this extremely strange macro is to avoid some braindamaged warning
- stupidity in gcc 4.1.x */
-#define talloc_steal(ctx, ptr) ({ _TALLOC_TYPEOF(ptr) __talloc_steal_ret = (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr)); __talloc_steal_ret; })
-#else
-#define talloc_set_destructor(ptr, function) \
- _talloc_set_destructor((ptr), (int (*)(void *))(function))
-#define _TALLOC_TYPEOF(ptr) void *
-#define talloc_steal(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr))
-#endif
-
-#define talloc_reference(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_reference((ctx),(ptr))
-#define talloc_move(ctx, ptr) (_TALLOC_TYPEOF(*(ptr)))_talloc_move((ctx),(void *)(ptr))
-
-/* useful macros for creating type checked pointers */
-#define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
-#define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__)
-#define talloc_ptrtype(ctx, ptr) (_TALLOC_TYPEOF(ptr))talloc_size(ctx, sizeof(*(ptr)))
-
-#define talloc_new(ctx) talloc_named_const(ctx, 0, "talloc_new: " __location__)
-
-#define talloc_zero(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
-#define talloc_zero_size(ctx, size) _talloc_zero(ctx, size, __location__)
-
-#define talloc_zero_array(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
-#define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
-#define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__)
-#define talloc_array_ptrtype(ctx, ptr, count) (_TALLOC_TYPEOF(ptr))talloc_array_size(ctx, sizeof(*(ptr)), count)
-#define talloc_array_length(ctx) (talloc_get_size(ctx)/sizeof(*ctx))
-
-#define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type)
-#define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__)
-
-#define talloc_memdup(t, p, size) _talloc_memdup(t, p, size, __location__)
-
-#define talloc_set_type(ptr, type) talloc_set_name_const(ptr, #type)
-#define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type)
-#define talloc_get_type_abort(ptr, type) (type *)_talloc_get_type_abort(ptr, #type, __location__)
-
-#define talloc_find_parent_bytype(ptr, type) (type *)talloc_find_parent_byname(ptr, #type)
-
-#if TALLOC_DEPRECATED
-#define talloc_zero_p(ctx, type) talloc_zero(ctx, type)
-#define talloc_p(ctx, type) talloc(ctx, type)
-#define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count)
-#define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count)
-#define talloc_destroy(ctx) talloc_free(ctx)
-#define talloc_append_string(c, s, a) (s?talloc_strdup_append(s,a):talloc_strdup(c, a))
-#endif
-
-#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
-
-/* The following definitions come from talloc.c */
-void *_talloc(const void *context, size_t size);
-void *talloc_pool(const void *context, size_t size);
-void _talloc_set_destructor(const void *ptr, int (*_destructor)(void *));
-int talloc_increase_ref_count(const void *ptr);
-size_t talloc_reference_count(const void *ptr);
-void *_talloc_reference(const void *context, const void *ptr);
-int talloc_unlink(const void *context, void *ptr);
-const char *talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-void talloc_set_name_const(const void *ptr, const char *name);
-void *talloc_named(const void *context, size_t size,
- const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
-void *talloc_named_const(const void *context, size_t size, const char *name);
-const char *talloc_get_name(const void *ptr);
-void *talloc_check_name(const void *ptr, const char *name);
-void *_talloc_get_type_abort(const void *ptr, const char *name, const char *location);
-void *talloc_parent(const void *ptr);
-const char *talloc_parent_name(const void *ptr);
-void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2);
-int talloc_free(void *ptr);
-void talloc_free_children(void *ptr);
-void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name);
-void *_talloc_steal(const void *new_ctx, const void *ptr);
-void *_talloc_move(const void *new_ctx, const void *pptr);
-size_t talloc_total_size(const void *ptr);
-size_t talloc_total_blocks(const void *ptr);
-void talloc_report_depth_cb(const void *ptr, int depth, int max_depth,
- void (*callback)(const void *ptr,
- int depth, int max_depth,
- int is_ref,
- void *private_data),
- void *private_data);
-void talloc_report_depth_file(const void *ptr, int depth, int max_depth, FILE *f);
-void talloc_report_full(const void *ptr, FILE *f);
-void talloc_report(const void *ptr, FILE *f);
-void talloc_enable_null_tracking(void);
-void talloc_disable_null_tracking(void);
-void talloc_enable_leak_report(void);
-void talloc_enable_leak_report_full(void);
-void *_talloc_zero(const void *ctx, size_t size, const char *name);
-void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name);
-void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name);
-void *talloc_realloc_fn(const void *context, void *ptr, size_t size);
-void *talloc_autofree_context(void);
-size_t talloc_get_size(const void *ctx);
-void *talloc_find_parent_byname(const void *ctx, const char *name);
-void talloc_show_parents(const void *context, FILE *file);
-int talloc_is_parent(const void *context, const void *ptr);
-
-char *talloc_strdup(const void *t, const char *p);
-char *talloc_strdup_append(char *s, const char *a);
-char *talloc_strdup_append_buffer(char *s, const char *a);
-
-char *talloc_strndup(const void *t, const char *p, size_t n);
-char *talloc_strndup_append(char *s, const char *a, size_t n);
-char *talloc_strndup_append_buffer(char *s, const char *a, size_t n);
-
-char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
-char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
-char *talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
-
-char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-
-void talloc_set_abort_fn(void (*abort_fn)(const char *reason));
@@ -1,7 +1,7 @@
#pragma once
#include <osmocom/core/backtrace.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
/*! \defgroup utils General-purpose utility functions
* @{
@@ -1,7 +1,7 @@
#pragma once
#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/logging.h>
@@ -8,4 +8,4 @@ Description: C Utility Library
Version: @VERSION@
Libs: -L${libdir} -losmocore
Cflags: -I${includedir}/
-@INTERNAL_TALLOC_FALSE@Requires: talloc
+Requires: talloc
@@ -26,12 +26,7 @@ libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) $(LIBRARY_DL) -no-undefined
else
libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined
endif
-
-if INTERNAL_TALLOC
-libosmocore_la_SOURCES += talloc.c
-else
libosmocore_la_LIBADD += $(TALLOC_LIBS)
-endif
if ENABLE_MSGFILE
libosmocore_la_SOURCES += msgfile.c
@@ -32,7 +32,7 @@
#include <osmocom/ctrl/control_cmd.h>
#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/vector.h>
@@ -46,7 +46,7 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/select.h>
#include <osmocom/core/statistics.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/socket.h>
#include <osmocom/gsm/protocol/ipaccess.h>
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/vty/telnet_interface.h>
@@ -29,7 +29,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_bssgp.h>
@@ -27,7 +27,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_bssgp_bss.h>
#include <osmocom/gprs/gprs_ns.h>
@@ -26,7 +26,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_ns.h>
@@ -28,7 +28,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_ns.h>
@@ -72,7 +72,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/socket.h>
@@ -33,7 +33,7 @@
#include <osmocom/core/select.h>
#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/socket.h>
#include <osmocom/gprs/gprs_ns.h>
@@ -28,7 +28,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_ns.h>
@@ -29,7 +29,7 @@
#include <arpa/inet.h>
#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/macaddr.h>
#include <osmocom/core/select.h>
@@ -80,7 +80,7 @@
#include <osmocom/core/timer.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/utils.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/gsm/lapd_core.h>
/* TS 04.06 Table 4 / Section 3.8.1 */
@@ -26,7 +26,7 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/socket.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
@@ -40,7 +40,7 @@
#include <time.h>
#include <errno.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
@@ -39,7 +39,7 @@
#include <strings.h>
#endif
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
@@ -31,7 +31,7 @@
#include <osmocom/core/msgb.h>
//#include <openbsc/gsm_data.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
//#include <openbsc/debug.h>
void *tall_msgb_ctx;
@@ -22,7 +22,7 @@
*/
#include <osmocom/core/msgfile.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -32,7 +32,7 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>
@@ -19,7 +19,7 @@
*/
#include <osmocom/core/signal.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/linuxlist.h>
#include <stdlib.h>
#include <string.h>
@@ -23,7 +23,7 @@
#include <string.h>
#include <osmocom/core/linuxlist.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/statistics.h>
static LLIST_HEAD(counters);
@@ -54,7 +54,7 @@
#define __USE_GNU
#include <string.h>
#undef __USE_GNU
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#endif /* not _TALLOC_SAMBA3 */
@@ -28,7 +28,7 @@
#include <stddef.h>
#include <sys/uio.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/vty/buffer.h>
#include <osmocom/vty/vty.h>
@@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */
#include <osmocom/vty/vty.h>
#include <osmocom/vty/command.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
/*! \addtogroup command
* @{
@@ -24,7 +24,7 @@
#include "../../config.h"
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/strrb.h>
@@ -28,7 +28,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/signal.h>
@@ -26,7 +26,7 @@
#include <ctype.h>
#include <osmocom/core/linuxlist.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/utils.h>
@@ -24,7 +24,7 @@
#include <osmocom/vty/vector.h>
#include <osmocom/vty/vty.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <memory.h>
void *tall_vty_vec_ctx;
@@ -54,7 +54,7 @@
#include <osmocom/vty/vty.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/buffer.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
/* \addtogroup vty
* @{
@@ -12,7 +12,7 @@
#include <osmocom/core/application.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/gprs/gprs_bssgp.h>
static unsigned long in_ctr = 1;
@@ -20,7 +20,7 @@
#include <osmocom/core/application.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_msgb.h>
@@ -20,7 +20,7 @@
*/
#include <osmocom/core/msgfile.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <stdio.h>
@@ -21,7 +21,7 @@
#include <string.h>
#include <osmocom/core/strrb.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
@@ -28,7 +28,7 @@
#include <getopt.h>
#include <unistd.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
#include <osmocom/core/linuxlist.h>
@@ -25,7 +25,7 @@
#include <sys/un.h>
#include <osmocom/core/application.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/signal.h>