FlashGraph-ng
A new frontier in large-scale graph analysis and data mining
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
mem_tracker.h
1 #ifndef __MEM_TRACKER_H__
2 #define __MEM_TRACKER_H__
3 
4 /*
5  * Copyright 2014 Open Connectome Project (http://openconnecto.me)
6  * Written by Da Zheng (zhengda1936@gmail.com)
7  *
8  * This file is part of SAFSlib.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include <stdlib.h>
24 
25 #ifdef ENABLE_MEM_TRACE
26 
27 #include <new>
28 
29 void *operator new(size_t n) throw (std::bad_alloc);
30 void operator delete(void *p) throw ();
31 void *operator new[](size_t n) throw (std::bad_alloc);
32 void operator delete[](void *p) throw ();
33 
34 #endif
35 
36 void mem_trace_start();
37 void mem_trace_stop();
38 
39 size_t get_alloc_objs();
40 size_t get_alloc_bytes();
41 size_t get_max_alloc_objs();
42 size_t get_max_alloc_bytes();
43 size_t get_max_alloc();
44 
45 #endif