heapTracker.h revision 4378
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico/*
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico *
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * Redistribution and use in source and binary forms, with or without
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * modification, are permitted provided that the following conditions
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * are met:
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico *
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * - Redistributions of source code must retain the above copyright
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * notice, this list of conditions and the following disclaimer.
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico *
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * - Redistributions in binary form must reproduce the above copyright
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * notice, this list of conditions and the following disclaimer in the
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico * documentation and/or other materials provided with the distribution.
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico *
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico * - Neither the name of Oracle nor the names of its
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico * contributors may be used to endorse or promote products derived
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico * from this software without specific prior written permission.
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico *
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico */
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico/*
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * This source code is provided to illustrate the usage of a given feature
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * or technique and has been deliberately simplified. Additional steps
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * required for a production-quality application, such as security checks,
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * input validation and proper error handling, might not be present in
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * this sample code.
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico */
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico/* Primary heapTracker #include file, should be included by most if not
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico * all heapTracker source files. Gives access to the global data structure
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico * and all global macros.
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico */
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico#ifndef HEAP_TRACKER_H
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#define HEAP_TRACKER_H
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico/* Standard C functions used throughout. */
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico#include <stdio.h>
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico#include <stdlib.h>
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico#include <string.h>
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#include <stddef.h>
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#include <stdarg.h>
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico/* General JVM/Java functions, types and macros. */
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico#include <sys/types.h>
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico#include "jni.h"
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#include "jvmti.h"
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico/* Utility functions */
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#include "agent_util.h"
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico/* Agent library externals to export. */
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNicoJNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved);
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNicoJNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm);
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico
037bf91e68f10e796fecad5054b332b003c3a562JazzyNico#endif
26c33d9562fa0e87aaecf2976da51d771d2b4cd0JazzyNico