parse: Use GLib malloc/free/realloc functions
authorSebastian Dröge <sebastian@centricular.com>
Fri, 27 Dec 2013 11:55:02 +0000 (12:55 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 27 Dec 2013 11:55:40 +0000 (12:55 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=720100

gst/parse/Makefile.am
gst/parse/parse.l

index 9227408..8dd1d9c 100644 (file)
@@ -14,7 +14,7 @@ EXTRA_DIST = \
 nodist_libgstparse_la_SOURCES = lex.priv_gst_parse_yy.c grammar.tab.c
 CLEANFILES += grammar.tab.c lex.priv_gst_parse_yy.c
 
-libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS)
+libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS) -DYYMALLOC=g_malloc -DYYFREE=g_free
 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
 
 noinst_HEADERS = grammar.tab.h parse_lex.h types.h
index bcd6527..97b8cce 100644 (file)
 #include "../gsturi.h"
 #include "grammar.tab.h"
 
+#ifdef malloc
+#undef malloc
+#endif
+
+#ifdef free
+#undef free
+#endif
+
+#ifdef realloc
+#undef realloc
+#endif
+
+#define malloc g_malloc
+#define free g_free
+#define realloc g_realloc
+
 /* Override the default ECHO so as to avoid fortify warnings. Ignore the
    embedded-NUL case for now. We know yytext is NUL-terminated. */
 #define ECHO g_fprintf(yyout, "%s", yytext)