equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * |
3 * |
4 * Redistribution and use in source and binary forms, with or without |
4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions |
5 * modification, are permitted provided that the following conditions |
6 * are met: |
6 * are met: |
7 * |
7 * |
371 |
371 |
372 /* Agent_OnLoad: This is called immediately after the shared library is |
372 /* Agent_OnLoad: This is called immediately after the shared library is |
373 * loaded. This is the first code executed. |
373 * loaded. This is the first code executed. |
374 */ |
374 */ |
375 JNIEXPORT jint JNICALL |
375 JNIEXPORT jint JNICALL |
376 Agent_OnLoad(JavaVM *vm, char *options, void *reserved) |
376 DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) |
377 { |
377 { |
378 static GlobalAgentData data; |
378 static GlobalAgentData data; |
379 jvmtiEnv *jvmti; |
379 jvmtiEnv *jvmti; |
380 jvmtiError error; |
380 jvmtiError error; |
381 jint res; |
381 jint res; |
465 |
465 |
466 /* Agent_OnUnload: This is called immediately before the shared library is |
466 /* Agent_OnUnload: This is called immediately before the shared library is |
467 * unloaded. This is the last code executed. |
467 * unloaded. This is the last code executed. |
468 */ |
468 */ |
469 JNIEXPORT void JNICALL |
469 JNIEXPORT void JNICALL |
470 Agent_OnUnload(JavaVM *vm) |
470 DEF_Agent_OnUnload(JavaVM *vm) |
471 { |
471 { |
472 /* Make sure all malloc/calloc/strdup space is freed */ |
472 /* Make sure all malloc/calloc/strdup space is freed */ |
473 if ( gdata->include != NULL ) { |
473 if ( gdata->include != NULL ) { |
474 (void)free((void*)gdata->include); |
474 (void)free((void*)gdata->include); |
475 gdata->include = NULL; |
475 gdata->include = NULL; |