New PHP5 APC - version 3.0.19, using PHP5 5.2.0-8+etch11,
[php5-apc.git] / apc_pool.h
1 /*
2   +----------------------------------------------------------------------+
3   | APC                                                                  |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 2008 The PHP Group                                     |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt.                                 |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Authors: Gopal Vijayaraghavan <gopalv@yahoo-inc.com>                 |
16   +----------------------------------------------------------------------+
17
18    This software was contributed to PHP by Yahoo! Inc. in 2008.
19    
20    Future revisions and derivatives of this source code must acknowledge
21    Yahoo! Inc. as the original contributor of this module by
22    leaving this note intact in the source code.
23
24    All other licensing and usage conditions are those of the PHP Group.
25
26  */
27
28 /* $Id: apc_pool.h,v 3.3 2008/01/09 12:30:39 gopalv Exp $ */
29
30 #ifndef APC_POOL_H
31 #define APC_POOL_H
32
33 #include "apc.h"
34 #include "apc_sma.h"
35
36 typedef enum {
37     APC_SMALL_POOL     = 0x1,
38     APC_MEDIUM_POOL    = 0x2,
39     APC_LARGE_POOL     = 0x3,
40     APC_POOL_SIZE_MASK = 0x7,   /* waste a bit */
41     APC_POOL_REDZONES  = 0x08,
42     APC_POOL_SIZEINFO  = 0x10,
43     APC_POOL_OPT_MASK  = 0x18
44 } apc_pool_type;
45
46 typedef struct _apc_pool apc_pool;
47
48 extern apc_pool* apc_pool_create(apc_pool_type pool_type, 
49                             apc_malloc_t allocate, 
50                             apc_free_t deallocate);
51
52
53 extern void apc_pool_destroy(apc_pool *pool);
54 extern void* apc_pool_alloc(apc_pool *pool, size_t size);
55 extern void apc_pool_free(apc_pool *pool, void *ptr);
56 extern int apc_pool_check_integrity(apc_pool *pool);
57
58 #endif