1 | #ifndef MALLOC_CTL_H
|
---|
2 | # define MALLOC_CTL_H
|
---|
3 |
|
---|
4 | struct perl_mstats {
|
---|
5 | UV *nfree;
|
---|
6 | UV *ntotal;
|
---|
7 | IV topbucket, topbucket_ev, topbucket_odd, totfree, total, total_chain;
|
---|
8 | IV total_sbrk, sbrks, sbrk_good, sbrk_slack, start_slack, sbrked_remains;
|
---|
9 | IV minbucket;
|
---|
10 | /* Level 1 info */
|
---|
11 | UV *bucket_mem_size;
|
---|
12 | UV *bucket_available_size;
|
---|
13 | UV nbuckets;
|
---|
14 | };
|
---|
15 | typedef struct perl_mstats perl_mstats_t;
|
---|
16 |
|
---|
17 | START_EXTERN_C
|
---|
18 | Malloc_t Perl_malloc (MEM_SIZE nbytes);
|
---|
19 | Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size);
|
---|
20 | Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes);
|
---|
21 | /* 'mfree' rather than 'free', since there is already a 'perl_free'
|
---|
22 | * that causes clashes with case-insensitive linkers */
|
---|
23 | Free_t Perl_mfree (Malloc_t where);
|
---|
24 | END_EXTERN_C
|
---|
25 |
|
---|
26 | #ifndef NO_MALLOC_DYNAMIC_CFG
|
---|
27 |
|
---|
28 | /* IV configuration data */
|
---|
29 | enum {
|
---|
30 | MallocCfg_FIRST_SBRK,
|
---|
31 | MallocCfg_MIN_SBRK,
|
---|
32 | MallocCfg_MIN_SBRK_FRAC1000,
|
---|
33 | MallocCfg_SBRK_ALLOW_FAILURES,
|
---|
34 | MallocCfg_SBRK_FAILURE_PRICE,
|
---|
35 | MallocCfg_sbrk_goodness,
|
---|
36 |
|
---|
37 | MallocCfg_filldead,
|
---|
38 | MallocCfg_fillalive,
|
---|
39 | MallocCfg_fillcheck,
|
---|
40 |
|
---|
41 | MallocCfg_skip_cfg_env,
|
---|
42 | MallocCfg_cfg_env_read,
|
---|
43 |
|
---|
44 | MallocCfg_emergency_buffer_size,
|
---|
45 | MallocCfg_emergency_buffer_last_req,
|
---|
46 |
|
---|
47 | MallocCfg_emergency_buffer_prepared_size,
|
---|
48 |
|
---|
49 | MallocCfg_last
|
---|
50 | };
|
---|
51 | /* char* configuration data */
|
---|
52 | enum {
|
---|
53 | MallocCfgP_emergency_buffer,
|
---|
54 | MallocCfgP_emergency_buffer_prepared,
|
---|
55 | MallocCfgP_last
|
---|
56 | };
|
---|
57 | START_EXTERN_C
|
---|
58 | extern IV *MallocCfg_ptr;
|
---|
59 | extern char **MallocCfgP_ptr;
|
---|
60 | END_EXTERN_C
|
---|
61 |
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #endif
|
---|