xref: /PHP-7.3/Zend/zend_alloc_sizes.h (revision 9afce019)
1 /*
2    +----------------------------------------------------------------------+
3    | Zend Engine                                                          |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt.                                |
11    | If you did not receive a copy of the Zend license and are unable to  |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@zend.com so we can mail you a copy immediately.              |
14    +----------------------------------------------------------------------+
15    | Authors: Dmitry Stogov <dmitry@php.net>                              |
16    +----------------------------------------------------------------------+
17 */
18 
19 #ifndef ZEND_ALLOC_SIZES_H
20 #define ZEND_ALLOC_SIZES_H
21 
22 #define ZEND_MM_CHUNK_SIZE (2 * 1024 * 1024)               /* 2 MB  */
23 #define ZEND_MM_PAGE_SIZE  (4 * 1024)                      /* 4 KB  */
24 #define ZEND_MM_PAGES      (ZEND_MM_CHUNK_SIZE / ZEND_MM_PAGE_SIZE)  /* 512 */
25 #define ZEND_MM_FIRST_PAGE (1)
26 
27 #define ZEND_MM_MIN_SMALL_SIZE		8
28 #define ZEND_MM_MAX_SMALL_SIZE      3072
29 #define ZEND_MM_MAX_LARGE_SIZE      (ZEND_MM_CHUNK_SIZE - (ZEND_MM_PAGE_SIZE * ZEND_MM_FIRST_PAGE))
30 
31 /* num, size, count, pages */
32 #define ZEND_MM_BINS_INFO(_, x, y) \
33 	_( 0,    8,  512, 1, x, y) \
34 	_( 1,   16,  256, 1, x, y) \
35 	_( 2,   24,  170, 1, x, y) \
36 	_( 3,   32,  128, 1, x, y) \
37 	_( 4,   40,  102, 1, x, y) \
38 	_( 5,   48,   85, 1, x, y) \
39 	_( 6,   56,   73, 1, x, y) \
40 	_( 7,   64,   64, 1, x, y) \
41 	_( 8,   80,   51, 1, x, y) \
42 	_( 9,   96,   42, 1, x, y) \
43 	_(10,  112,   36, 1, x, y) \
44 	_(11,  128,   32, 1, x, y) \
45 	_(12,  160,   25, 1, x, y) \
46 	_(13,  192,   21, 1, x, y) \
47 	_(14,  224,   18, 1, x, y) \
48 	_(15,  256,   16, 1, x, y) \
49 	_(16,  320,   64, 5, x, y) \
50 	_(17,  384,   32, 3, x, y) \
51 	_(18,  448,    9, 1, x, y) \
52 	_(19,  512,    8, 1, x, y) \
53 	_(20,  640,   32, 5, x, y) \
54 	_(21,  768,   16, 3, x, y) \
55 	_(22,  896,    9, 2, x, y) \
56 	_(23, 1024,    8, 2, x, y) \
57 	_(24, 1280,   16, 5, x, y) \
58 	_(25, 1536,    8, 3, x, y) \
59 	_(26, 1792,   16, 7, x, y) \
60 	_(27, 2048,    8, 4, x, y) \
61 	_(28, 2560,    8, 5, x, y) \
62 	_(29, 3072,    4, 3, x, y)
63 
64 #endif /* ZEND_ALLOC_SIZES_H */
65 
66 /*
67  * Local variables:
68  * tab-width: 4
69  * c-basic-offset: 4
70  * indent-tabs-mode: t
71  * End:
72  * vim600: sw=4 ts=4 fdm=marker
73  * vim<600: sw=4 ts=4
74  */
75