1 /****************************************************************************
2  *
3  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
4  * Copyright (C) 2003-2013 Sourcefire, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License Version 2 as
8  * published by the Free Software Foundation.  You may not use, modify or
9  * distribute this program under any other version of the GNU General
10  * Public License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20  *
21  ****************************************************************************/
22 
23 /*
24 **  sfmemcap.h
25 */
26 #ifndef __SF_MEMCAP_H__
27 #define __SF_MEMCAP_H__
28 
29 typedef struct
30 {
31    unsigned long memused;
32    unsigned long memcap;
33    int      nblocks;
34 
35 }MEMCAP;
36 
37 void     sfmemcap_init(MEMCAP * mc, unsigned long nbytes);
38 MEMCAP * sfmemcap_new( unsigned nbytes );
39 void     sfmemcap_delete( MEMCAP * mc );
40 void   * sfmemcap_alloc(MEMCAP * mc, unsigned long nbytes);
41 void     sfmemcap_showmem(MEMCAP * mc );
42 void     sfmemcap_free( MEMCAP * mc, void * memory);
43 void   * sfmemcap_dupmem(MEMCAP * mc, void * src, unsigned long n );
44 
45 #endif
46