modified: tags
[yuchen.git] / sfmemcap.h
blob694c4248b0fb42d9266bf3945c34e8cadebbc97a
1 /****************************************************************************
3 * Copyright (C) 2003-2009 Sourcefire, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License Version 2 as
7 * published by the Free Software Foundation. You may not use, modify or
8 * distribute this program under any other version of the GNU General
9 * Public License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 ****************************************************************************/
23 ** sfmemcap.h
25 #ifndef __SF_MEMCAP_H__
26 #define __SF_MEMCAP_H__
28 typedef struct
30 unsigned memused;
31 unsigned memcap;
32 int nblocks;
34 }MEMCAP;
36 void sfmemcap_init(MEMCAP * mc, unsigned nbytes);
37 MEMCAP * sfmemcap_new( unsigned nbytes );
38 void sfmemcap_delete( MEMCAP * mc );
39 void * sfmemcap_alloc(MEMCAP * mc, unsigned nbytes);
40 void sfmemcap_showmem(MEMCAP * mc );
41 void sfmemcap_free( MEMCAP * mc, void * memory);
42 char * sfmemcap_strdup(MEMCAP * mc, const char *str);
43 void * sfmemcap_dupmem(MEMCAP * mc, void * src, int n );
45 #endif