X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Flib%2Fsmartall.h;h=439f990ea148011e1ff3b67bcbee330fec8d9965;hb=95c6245affef4000580427d5e0855227dedcd9dc;hp=82685a3e76435081b9b47b3e6c3a7eb7e43c1f0d;hpb=80e8d2acef16d7bddf47b8c905453bb1d83d65ca;p=bacula%2Fbacula diff --git a/bacula/src/lib/smartall.h b/bacula/src/lib/smartall.h index 82685a3e76..439f990ea1 100644 --- a/bacula/src/lib/smartall.h +++ b/bacula/src/lib/smartall.h @@ -1,35 +1,30 @@ /* Definitions for the smart memory allocator - + Version $Id$ */ /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program 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 - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ -extern uint64_t sm_max_bytes; -extern uint64_t sm_bytes; -extern uint32_t sm_max_buffers; -extern uint32_t sm_buffers; +extern uint64_t DLL_IMP_EXP sm_max_bytes; +extern uint64_t DLL_IMP_EXP sm_bytes; +extern uint32_t DLL_IMP_EXP sm_max_buffers; +extern uint32_t DLL_IMP_EXP sm_buffers; #ifdef SMARTALLOC #undef SMARTALLOC @@ -84,7 +79,7 @@ extern int sm_check_rtn(const char *fname, int lineno, bool bufdump); #define sm_check_rtn(f, l, fl) 1 extern void *b_malloc(); -#define malloc(x) b_malloc(__FILE__, __LINE__, (x)) +#define malloc(x) b_malloc(__FILE__, __LINE__, (x)) #endif @@ -100,12 +95,12 @@ public: void *operator new(size_t s, const char *fname, int line) { - void *p = sm_malloc(fname, line, s > sizeof(int) ? s : sizeof(int)); + void *p = sm_malloc(fname, line, s > sizeof(int) ? (unsigned int)s : sizeof(int)); return p; } void *operator new[](size_t s, const char *fname, int line) { - void *p = sm_malloc(fname, line, s > sizeof(int) ? s : sizeof(int)); + void *p = sm_malloc(fname, line, s > sizeof(int) ? (unsigned int)s : sizeof(int)); return p; } void operator delete(void *ptr) @@ -117,11 +112,21 @@ void operator delete[](void *ptr, size_t i) free(ptr); } +void operator delete(void *ptr, const char *fname, int line) +{ + free(ptr); +} +void operator delete[](void *ptr, size_t i, const char *fname, int line) +{ + free(ptr); +} + + private: void *operator new(size_t s) throw() { return 0; } void *operator new[](size_t s) throw() { return 0; } }; - + #else