PIPS
malloc-info.c
Go to the documentation of this file.
1 /*
2 
3  $Id: malloc-info.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 #include "stdio.h"
28 #include "stdlib.h"
29 
30 /* mallinfo portability os restricted to SUN C library */
31 void
32 print_malloc_info(__attribute__((unused)) FILE * fd)
33 {
34 /*
35  static struct mallinfo m;
36 
37  m = mallinfo();
38 
39  user_log("print_malloc_info", "T: %d U: %d F: %d\n",
40  m.arena, m.uordblks, m.fordblks);
41  */
42 }
43 
44 void print_full_malloc_info(__attribute__((unused)) FILE * fd)
45 {
46 /*
47  static struct mallinfo m;
48 
49  m = mallinfo();
50 
51  user_log("print_full_malloc_info",
52  "total space in arena: %d\n",
53  m.arena);
54  user_log("print_full_malloc_info",
55  "number of ordinary blocks: %d\n",
56  m.ordblks);
57  user_log("print_full_malloc_info",
58  "number of small blocks: %d\n",
59  m.smblks);
60  user_log("print_full_malloc_info",
61  "number of holding blocks: %d\n",
62  m.hblks);
63  user_log("print_full_malloc_info",
64  "space in holding block headers: %d\n",
65  m.hblkhd);
66  user_log("print_full_malloc_info",
67  "space in small blocks in use: %d\n",
68  m.usmblks);
69  user_log("print_full_malloc_info",
70  "space in free small blocks: %d\n",
71  m.fsmblks);
72  user_log("print_full_malloc_info",
73  "space in ordinary blocks in use: %d\n",
74  m.uordblks);
75  user_log("print_full_malloc_info",
76  "space in free ordinary blocks: %d\n",
77  m.fordblks);
78  user_log("print_full_malloc_info",
79  "cost of enabling keep option: %d\n",
80  m.keepcost);
81 #ifdef sun
82  user_log("print_full_malloc_info",
83  "max size of small blocks: %d\n",
84  m.mxfast);
85  user_log("print_full_malloc_info",
86  "number of small blocks in a holding block: %d\n",
87  m.nlblks);
88  user_log("print_full_malloc_info",
89  "small block rounding factor: %d\n",
90  m.grain);
91  user_log("print_full_malloc_info",
92  "space (including overhead) allocated in ord. blks: %d\n",
93  m.uordbytes);
94  user_log("print_full_malloc_info",
95  "number of ordinary blocks allocated: %d\n",
96  m.allocated);
97  user_log("print_full_malloc_info",
98  "bytes used in maintaining the free tree: %d\n",
99  m.treeoverhead);
100 #endif
101 */
102 }
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
void print_full_malloc_info(__attribute__((unused)) FILE *fd)
Definition: malloc-info.c:44
void print_malloc_info(__attribute__((unused)) FILE *fd)
mallinfo portability os restricted to SUN C library
Definition: malloc-info.c:32