mallocTracker.inline.hpp revision 6853:91eeb8807a03
1323136Sdes/*
260573Skris * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
392555Sdes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
460573Skris *
560573Skris * This code is free software; you can redistribute it and/or modify it
660573Skris * under the terms of the GNU General Public License version 2 only, as
760573Skris * published by the Free Software Foundation.
860573Skris *
960573Skris * This code is distributed in the hope that it will be useful, but WITHOUT
1060573Skris * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1160573Skris * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1260573Skris * version 2 for more details (a copy is included in the LICENSE file that
1360573Skris * accompanied this code).
1460573Skris *
1560573Skris * You should have received a copy of the GNU General Public License version
1660573Skris * 2 along with this work; if not, write to the Free Software Foundation,
1760573Skris * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1860573Skris *
1960573Skris * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2060573Skris * or visit www.oracle.com if you need additional information or have any
2160573Skris * questions.
2260573Skris *
2360573Skris */
2460573Skris
2560573Skris#ifndef SHARE_VM_SERVICES_MALLOC_TRACKER_INLINE_HPP
2660573Skris#define SHARE_VM_SERVICES_MALLOC_TRACKER_INLINE_HPP
2760573Skris
28162852Sdes#include "services/mallocTracker.hpp"
29162852Sdes#include "services/memTracker.hpp"
30162852Sdes
31162852Sdesinline NMT_TrackingLevel MallocTracker::get_memory_tracking_level(void* memblock) {
32162852Sdes  assert(memblock != NULL, "Sanity check");
33162852Sdes  if (MemTracker::tracking_level() == NMT_off) return NMT_off;
34162852Sdes  MallocHeader* header = malloc_header(memblock);
35294328Sdes  return header->tracking_level();
3676259Sgreen}
37323129Sdes
38294328Sdesinline void* MallocTracker::get_base(void* memblock){
3976259Sgreen  return get_base(memblock, MemTracker::tracking_level());
4060573Skris}
4161209Skris
4260573Skris#endif // SHARE_VM_SERVICES_MALLOC_TRACKER_INLINE_HPP
4376259Sgreen
44294332Sdes