diff mbox

[5/5] build: remove bundled copy of talloc

Message ID 1412413825-24016-6-git-send-email-jengelh@inai.de
State Superseded
Headers show

Commit Message

Jan Engelhardt Oct. 4, 2014, 9:10 a.m. UTC
Mailing list discussion showed that the bundled talloc idea was
not so good after all.
---
 .gitignore                         |   1 -
 configure.ac                       |  23 +----
 include/Makefile.am                |   5 -
 include/osmocom/core/strrb.h       |   2 +-
 include/osmocom/core/talloc.h.in   |   6 --
 include/osmocom/core/talloc_int.h  | 189 -------------------------------------
 include/osmocom/core/utils.h       |   2 +-
 include/osmocom/ctrl/control_cmd.h |   2 +-
 libosmocore.pc.in                  |   2 +-
 src/Makefile.am                    |   5 -
 src/ctrl/control_cmd.c             |   2 +-
 src/ctrl/control_if.c              |   2 +-
 src/gb/common_vty.c                |   2 +-
 src/gb/gprs_bssgp.c                |   2 +-
 src/gb/gprs_bssgp_bss.c            |   2 +-
 src/gb/gprs_bssgp_util.c           |   2 +-
 src/gb/gprs_bssgp_vty.c            |   2 +-
 src/gb/gprs_ns.c                   |   2 +-
 src/gb/gprs_ns_frgre.c             |   2 +-
 src/gb/gprs_ns_vty.c               |   2 +-
 src/gsm/ipa.c                      |   2 +-
 src/gsm/lapd_core.c                |   2 +-
 src/gsmtap_util.c                  |   2 +-
 src/logging.c                      |   2 +-
 src/logging_syslog.c               |   2 +-
 src/msgb.c                         |   2 +-
 src/msgfile.c                      |   2 +-
 src/rate_ctr.c                     |   2 +-
 src/signal.c                       |   2 +-
 src/statistics.c                   |   2 +-
 src/talloc.c                       |   2 +-
 src/vty/buffer.c                   |   2 +-
 src/vty/command.c                  |   2 +-
 src/vty/logging_vty.c              |   2 +-
 src/vty/telnet_interface.c         |   2 +-
 src/vty/utils.c                    |   2 +-
 src/vty/vector.c                   |   2 +-
 src/vty/vty.c                      |   2 +-
 tests/gb/bssgp_fc_test.c           |   2 +-
 tests/gb/gprs_ns_test.c            |   2 +-
 tests/msgfile/msgfile_test.c       |   2 +-
 tests/strrb/strrb_test.c           |   2 +-
 tests/timer/timer_test.c           |   2 +-
 tests/vty/vty_test.c               |   2 +-
 44 files changed, 39 insertions(+), 266 deletions(-)
 delete mode 100644 include/osmocom/core/talloc.h.in
 delete mode 100644 include/osmocom/core/talloc_int.h

Comments

Holger Freyther Oct. 4, 2014, 9:59 a.m. UTC | #1
On Sat, Oct 04, 2014 at 11:10:25AM +0200, Jan Engelhardt wrote:

> diff --git a/include/osmocom/core/talloc.h.in b/include/osmocom/core/talloc.h.in
> deleted file mode 100644
> index edbbb63..0000000
> --- a/include/osmocom/core/talloc.h.in
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -#pragma once
> -#if @OSMOCORE_INTERNAL_TALLOC@
> -#include <osmocom/core/talloc_int.h>
> -#else
> -#include <talloc.h>
> -#endif

leave it for a transition period.

> --- a/include/osmocom/ctrl/control_cmd.h
> +++ b/include/osmocom/ctrl/control_cmd.h
> @@ -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>

In general these blocks are grouped. E.g. from most specific to
general (specially to make sure that a header file can be included
directly). So all of the #include <talloc.h> are at the wrong place
now. Either it is done correctly right now or leave osmocom/core/talloc.h
for a transition period.


thanks for working on it
	holger
Jan Engelhardt Oct. 4, 2014, 10:11 a.m. UTC | #2
On Saturday 2014-10-04 11:59, Holger Hans Peter Freyther wrote:
>On Sat, Oct 04, 2014 at 11:10:25AM +0200, Jan Engelhardt wrote:
>>  
>>  #include <osmocom/core/msgb.h>
>> -#include <osmocom/core/talloc.h>
>> +#include <talloc.h>
>>  #include <osmocom/core/write_queue.h>
>>  #include <osmocom/core/logging.h>
>
>In general these blocks are grouped. E.g. from most specific to
>general (specially to make sure that a header file can be included
>directly). So all of the #include <talloc.h> are at the wrong place
>now. Either it is done correctly right now or leave osmocom/core/talloc.h
>for a transition period.

Just take the first four then.
diff mbox

Patch

diff --git a/.gitignore b/.gitignore
index 30707a6..1299028 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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?
diff --git a/configure.ac b/configure.ac
index f12675a..68ef830 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/include/Makefile.am b/include/Makefile.am
index d8af474..858140c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -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
diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h
index c563d1b..2c7cfb2 100644
--- a/include/osmocom/core/strrb.h
+++ b/include/osmocom/core/strrb.h
@@ -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 */
 
diff --git a/include/osmocom/core/talloc.h.in b/include/osmocom/core/talloc.h.in
deleted file mode 100644
index edbbb63..0000000
--- a/include/osmocom/core/talloc.h.in
+++ /dev/null
@@ -1,6 +0,0 @@ 
-#pragma once
-#if @OSMOCORE_INTERNAL_TALLOC@
-#include <osmocom/core/talloc_int.h>
-#else
-#include <talloc.h>
-#endif
diff --git a/include/osmocom/core/talloc_int.h b/include/osmocom/core/talloc_int.h
deleted file mode 100644
index dde102b..0000000
--- a/include/osmocom/core/talloc_int.h
+++ /dev/null
@@ -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));
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 373522a..b627c7b 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -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
  *  @{
diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h
index 8f2eaa2..c5b7162 100644
--- a/include/osmocom/ctrl/control_cmd.h
+++ b/include/osmocom/ctrl/control_cmd.h
@@ -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>
 
diff --git a/libosmocore.pc.in b/libosmocore.pc.in
index 2ec6a74..7a9b925 100644
--- a/libosmocore.pc.in
+++ b/libosmocore.pc.in
@@ -8,4 +8,4 @@  Description: C Utility Library
 Version: @VERSION@
 Libs: -L${libdir} -losmocore
 Cflags: -I${includedir}/
-@INTERNAL_TALLOC_FALSE@Requires: talloc
+Requires: talloc
diff --git a/src/Makefile.am b/src/Makefile.am
index 4a6ba5c..8050ad0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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
diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index 4e156b8..4d47145 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.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>
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index c20c1e0..364a092 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -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>
diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c
index 0bd0b6c..030b2a6 100644
--- a/src/gb/common_vty.c
+++ b/src/gb/common_vty.c
@@ -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>
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 0e9fd38..b002286 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -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>
diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c
index 7d4c07c..5094e76 100644
--- a/src/gb/gprs_bssgp_bss.c
+++ b/src/gb/gprs_bssgp_bss.c
@@ -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>
diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c
index 604764c..0e534df 100644
--- a/src/gb/gprs_bssgp_util.c
+++ b/src/gb/gprs_bssgp_util.c
@@ -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>
 
diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c
index d8e1d32..0a2b05b 100644
--- a/src/gb/gprs_bssgp_vty.c
+++ b/src/gb/gprs_bssgp_vty.c
@@ -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>
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index ee2d7ec..0f27710 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -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>
diff --git a/src/gb/gprs_ns_frgre.c b/src/gb/gprs_ns_frgre.c
index 57cf65e..9b7e92e 100644
--- a/src/gb/gprs_ns_frgre.c
+++ b/src/gb/gprs_ns_frgre.c
@@ -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>
 
diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c
index 4fa60ad..d4b7812 100644
--- a/src/gb/gprs_ns_vty.c
+++ b/src/gb/gprs_ns_vty.c
@@ -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>
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index a49d8ac..77136f1 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -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>
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index 8c5fe9c..d7401de 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -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 */
diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c
index 82690a9..fe9d30b 100644
--- a/src/gsmtap_util.c
+++ b/src/gsmtap_util.c
@@ -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>
diff --git a/src/logging.c b/src/logging.c
index f9d789d..d636170 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -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>
 
diff --git a/src/logging_syslog.c b/src/logging_syslog.c
index 5b0ae5f..202b3d1 100644
--- a/src/logging_syslog.c
+++ b/src/logging_syslog.c
@@ -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>
 
diff --git a/src/msgb.c b/src/msgb.c
index b2fe1d2..d169d56 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -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;
diff --git a/src/msgfile.c b/src/msgfile.c
index 1a99184..d4cc567 100644
--- a/src/msgfile.c
+++ b/src/msgfile.c
@@ -22,7 +22,7 @@ 
  */
 
 #include <osmocom/core/msgfile.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 8a232e8..602e060 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -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>
 
diff --git a/src/signal.c b/src/signal.c
index 6384384..68be30f 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -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>
diff --git a/src/statistics.c b/src/statistics.c
index e28541b..0e559d8 100644
--- a/src/statistics.c
+++ b/src/statistics.c
@@ -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);
diff --git a/src/talloc.c b/src/talloc.c
index d3a0690..b3c0146 100644
--- a/src/talloc.c
+++ b/src/talloc.c
@@ -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 */
 
diff --git a/src/vty/buffer.c b/src/vty/buffer.c
index e385f9f..ecfb961 100644
--- a/src/vty/buffer.c
+++ b/src/vty/buffer.c
@@ -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>
 
diff --git a/src/vty/command.c b/src/vty/command.c
index 44a1b6c..bf83a74 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -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
  * @{
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 47877fe..0faa17f 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -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>
diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index 50b08c8..bd4037f 100644
--- a/src/vty/telnet_interface.c
+++ b/src/vty/telnet_interface.c
@@ -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>
 
diff --git a/src/vty/utils.c b/src/vty/utils.c
index d0ad431..d7df523 100644
--- a/src/vty/utils.c
+++ b/src/vty/utils.c
@@ -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>
diff --git a/src/vty/vector.c b/src/vty/vector.c
index 4012f24..6a4f4bd 100644
--- a/src/vty/vector.c
+++ b/src/vty/vector.c
@@ -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;
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 10a323f..1739d92 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -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
  * @{
diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c
index 64e4b4e..bc9ab39 100644
--- a/tests/gb/bssgp_fc_test.c
+++ b/tests/gb/bssgp_fc_test.c
@@ -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;
diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index c90d752..c51f643 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -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>
diff --git a/tests/msgfile/msgfile_test.c b/tests/msgfile/msgfile_test.c
index 2684b6a..1dd922b 100644
--- a/tests/msgfile/msgfile_test.c
+++ b/tests/msgfile/msgfile_test.c
@@ -20,7 +20,7 @@ 
  */
 
 #include <osmocom/core/msgfile.h>
-#include <osmocom/core/talloc.h>
+#include <talloc.h>
 
 #include <stdio.h>
 
diff --git a/tests/strrb/strrb_test.c b/tests/strrb/strrb_test.c
index 6140ac9..9b8ec34 100644
--- a/tests/strrb/strrb_test.c
+++ b/tests/strrb/strrb_test.c
@@ -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>
 
diff --git a/tests/timer/timer_test.c b/tests/timer/timer_test.c
index 6184f66..67a22c7 100644
--- a/tests/timer/timer_test.c
+++ b/tests/timer/timer_test.c
@@ -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>
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c
index 2a7347f..67c8679 100644
--- a/tests/vty/vty_test.c
+++ b/tests/vty/vty_test.c
@@ -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>