malloc()/free(). Tweek wx-console to use bmalloc()/bfree() for Bacula
calls.
kes correct improper indenting in wx-console/console_conf.c
kes update wx-console header copyrights
kes Fix bug #658 where wx-console mangles file/directory names containing
commas.
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3368
91ce42f0-d328-0410-95d8-
f526ca767f89
#include "baconfig.h"
#include "lib/lib.h"
+/*
+ * For wx-console compiles, we undo some Bacula defines.
+ * This prevents conflicts between wx-Widgets and Bacula.
+ * In wx-console files that malloc or free() Bacula structures
+ * config/resources and interface to the Bacula libraries,
+ * you must use bmalloc() and bfree().
+ */
#ifdef HAVE_WXCONSOLE
#undef New
#undef _
+#undef free
+#undef malloc
#endif
#if defined(HAVE_WIN32)
-#ifndef DEBUG
+#ifndef bmalloc
void *bmalloc(size_t size)
{
void *buf;
+#ifdef SMARTALLOC
+ buf = sm_malloc(file, line, size);
+#else
buf = malloc(size);
+#endif
if (buf == NULL) {
berrno be;
Emsg1(M_ABORT, 0, _("Out of memory: ERR=%s\n"), be.strerror());
}
+void bfree(void *buf)
+{
+#ifdef SMARTALLOC
+ sm_free(__FILE__, __LINE__, buf);
+#else
+ free(buf);
+#endif
+}
+
+
+
+
void *brealloc (void *buf, size_t size)
{
buf = realloc(buf, size);
bool bstrcmp (const char *s1, const char *s2);
int cstrlen (const char *str);
void *b_malloc (const char *file, int line, size_t size);
-#ifndef DEBUG
+#ifndef bmalloc
void *bmalloc (size_t size);
#endif
+void bfree (void *buf);
void *brealloc (void *buf, size_t size);
void *bcalloc (size_t size1, size_t size2);
int bsnprintf (char *str, int32_t size, const char *format, ...);
Technical notes on version 1.39
General:
+25Aug06
+kes wx-console crashes because of differences between Bacula and wxWidgets
+ malloc()/free(). Tweek wx-console to use bmalloc()/bfree() for Bacula
+ calls.
+kes correct improper indenting in wx-console/console_conf.c
+kes update wx-console header copyrights
+kes Fix bug #658 where wx-console mangles file/directory names containing
+ commas.
24Aug06
kes Add Media.Enabled flag to client backups for dotcmds.c
kes Enforce Media.Enabled=1 for a current restore to work.