]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/mem_pool.h
kes Add dynamic dll entry point for SHGetFolderPath to Win32 code.
[bacula/bacula] / bacula / src / lib / mem_pool.h
index 62b508f99f610e61d54d7eb6c4b957e2ac1500ce..0a6b123e7645b657af61ed225579060aa1fbafba 100644 (file)
@@ -6,24 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Bacula® - The Network Backup Solution
 
-   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.
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   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.
+
+   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.
+   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., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
- */
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #ifndef __MEM_POOL_H_
 #define __MEM_POOL_H_
@@ -46,8 +54,8 @@ extern POOLMEM  *sm_realloc_pool_memory(const char *fname, int line, POOLMEM *bu
 #define check_pool_memory_size(buf,size) sm_check_pool_memory_size(__FILE__, __LINE__, buf, size)
 extern POOLMEM  *sm_check_pool_memory_size(const char *fname, int line, POOLMEM *buf, int32_t size);
 
-#define free_pool_memory(x) sm_free_pool_memory(__FILE__, __LINE__, x) 
-#define free_memory(x) sm_free_pool_memory(__FILE__, __LINE__, x) 
+#define free_pool_memory(x) sm_free_pool_memory(__FILE__, __LINE__, x)
+#define free_memory(x) sm_free_pool_memory(__FILE__, __LINE__, x)
 extern void sm_free_pool_memory(const char *fname, int line, POOLMEM *buf);
 
 
@@ -62,11 +70,12 @@ extern POOLMEM  *check_pool_memory_size(POOLMEM *buf, int32_t size);
 extern void   free_pool_memory(POOLMEM *buf);
 
 #endif
+
+extern void garbage_collect_memory_pool();
 extern void  close_memory_pool();
 extern void  print_memory_pool_stats();
 
-   
+
 
 #define PM_NOPOOL  0                  /* nonpooled memory */
 #define PM_NAME    1                  /* Bacula name */
@@ -83,10 +92,12 @@ public:
    ~POOL_MEM() { free_pool_memory(mem); mem = NULL; }
    char *c_str() const { return mem; }
    int size() const { return sizeof_pool_memory(mem); }
-   char *check_size(int32_t size) { 
+   char *check_size(int32_t size) {
       mem = check_pool_memory_size(mem, size);
       return mem;
    }
+   int32_t max_size();
+   void realloc_pm(int32_t size);
    int strcpy(const char *str);
    int strcat(const char *str);
 };