]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/smartall.h
Implement first cut of Copy Job
[bacula/bacula] / bacula / src / lib / smartall.h
index 3472566fda1f94b01380c79fac35f3b9aeaa2f1b..6661e089a4e61a52da9133e90ae87415edc4328d 100644 (file)
@@ -1,21 +1,14 @@
-/*
-
-        Definitions for the smart memory allocator
-
-     Version $Id$
-
-*/
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+
+        Definitions for the smart memory allocator
+
+     Version $Id$
+
+*/
 
 extern uint64_t DLL_IMP_EXP sm_max_bytes;
 extern uint64_t DLL_IMP_EXP sm_bytes;
@@ -52,13 +52,15 @@ extern void *sm_malloc(const char *fname, int lineno, unsigned int nbytes),
             *actuallyrealloc(void *ptr, unsigned int size);
 extern void sm_free(const char *fname, int lineno, void *fp);
 extern void actuallyfree(void *cp),
-            sm_dump(bool bufdump), sm_static(int mode);
+            sm_dump(bool bufdump, bool in_use=false), sm_static(int mode);
 extern void sm_new_owner(const char *fname, int lineno, char *buf);
 
 #ifdef SMCHECK
+#define Dsm_check(lvl) if ((lvl)<=debug_level) sm_check(__FILE__, __LINE__, true)
 extern void sm_check(const char *fname, int lineno, bool bufdump);
 extern int sm_check_rtn(const char *fname, int lineno, bool bufdump);
 #else
+#define Dsm_check(lvl)
 #define sm_check(f, l, fl)
 #define sm_check_rtn(f, l, fl) 1
 #endif
@@ -121,22 +123,25 @@ void  operator delete(void *ptr)
 }
 void  operator delete[](void *ptr, size_t i)
 {
+   (void)i;                           /* eliminate compiler complaints */
    free(ptr);
 }
 
 void  operator delete(void *ptr, const char *fname, int line)
 {
+   (void)fname; (void)line;          /* eliminate compiler complaints */
    free(ptr);
 }
 void  operator delete[](void *ptr, size_t i, const char *fname, int line)
 {
+   (void)i; (void)fname; (void)line; /* eliminate compiler complaints */
    free(ptr);
 }
 
 
 private:
-void *operator new(size_t s) throw() { return 0; }
-void *operator new[](size_t s) throw() { return 0; }
+void *operator new(size_t s) throw() { (void)s; return 0; }
+void *operator new[](size_t s) throw() { (void)s; return 0; }
 };