summaryrefslogtreecommitdiff
path: root/include/m_string.h
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-06-24 13:41:33 -0700
committerunknown <jimw@mysql.com>2005-06-24 13:41:33 -0700
commitf56dd2a0fa24b154aa71307e12283e43c7ff0914 (patch)
treef29e416cf6a91425d2edb7c5e7cca1dde42543f6 /include/m_string.h
parentd34e2ccb3ea51811552f3e87ad68ee8673804da1 (diff)
downloadmariadb-git-f56dd2a0fa24b154aa71307e12283e43c7ff0914.tar.gz
Add my_str_malloc and _free function pointers to strings library
which will by default exit(1) if malloc() fails, but can be set to do something else by the calling program does, which mysqld does to use my_malloc(..., MYF(MY_FAE)) instead. Also checks allocation in conf_to_src utility program. (Bug #7003) strings/conf_to_src.c: if malloc() fails, just abort VC++Files/client/mysqlclient.dsp: Add str_alloc.c VC++Files/client/mysqlclient_ia64.dsp: Add str_alloc.c VC++Files/libmysql/libmysql.dsp: Add str_alloc.c VC++Files/libmysql/libmysql_ia64.dsp: Add str_alloc.c VC++Files/libmysqld/libmysqld.dsp: Add str_alloc.c VC++Files/libmysqld/libmysqld_ia64.dsp: Add str_alloc.c VC++Files/strings/backup/strings.dsp: Add str_alloc.c VC++Files/strings/noMASM/strings.dsp: Add str_alloc.c VC++Files/strings/strings.dsp: Add str_alloc.c VC++Files/strings/strings_ia64.dsp: Add str_alloc.c include/m_string.h: Add my_str_malloc/free function pointers. libmysql/Makefile.shared: Add str_alloc.lo sql/mysqld.cc: Reassign my_str_malloc/free pointers so they use my_malloc/free strings/Makefile.am: Add str_alloc.c strings/ctype-tis620.c: Use my_str_malloc/free
Diffstat (limited to 'include/m_string.h')
-rw-r--r--include/m_string.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/m_string.h b/include/m_string.h
index d3465363beb..33ba9c155c2 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -88,6 +88,13 @@
extern "C" {
#endif
+/*
+ my_str_malloc() and my_str_free() are assigned to implementations in
+ strings/alloc.c, but can be overridden in the calling program.
+ */
+extern void *(*my_str_malloc)(size_t);
+extern void (*my_str_free)(void *);
+
#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread)
#define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy