110305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu/*
2e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman * Copyright 2011, The Android Open Source Project
310305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu *
410305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * Licensed under the Apache License, Version 2.0 (the "License");
510305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * you may not use this file except in compliance with the License.
610305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * You may obtain a copy of the License at
710305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu *
8e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman *     http://www.apache.org/licenses/LICENSE-2.0
910305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu *
1010305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * Unless required by applicable law or agreed to in writing, software
1110305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * distributed under the License is distributed on an "AS IS" BASIS,
1210305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * See the License for the specific language governing permissions and
1410305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu * limitations under the License.
1510305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu */
16e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman#ifndef MEMORY_LEAK_TRACK_UTIL_H
17e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman#define MEMORY_LEAK_TRACK_UTIL_H
1810305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu
19e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman#include <iostream>
2010305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu
2110305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wunamespace android {
22e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman/*
23e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman * Dump the heap memory of the calling process, sorted by total size
24e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman * (allocation size * number of allocations).
25e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman *
26e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman *    limit is the number of unique allocations to return.
27e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman */
28e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatramanextern std::string dumpMemoryAddresses(size_t limit);
2910305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu
3010305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu};
3110305cc672dcb39b7cc7dc03eeafffb2fea150ecRonghua Wu
32e2b43843fd12783188edd2c54188ea8d26864788Vijay Venkatraman#endif  // MEMORY_LEAK_TRACK_UTIL_H
33