1 /*
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
41
42 typedef BOOL (WINAPI *SetSecurityDescriptorControlFnPtr)(
43 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
44 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
45 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet);
46
47 // Standard Memory Implementation Details
48
49 // create the PerfData memory region in standard memory.
50 //
51 static char* create_standard_memory(size_t size) {
52
53 // allocate an aligned chuck of memory
54 char* mapAddress = os::reserve_memory(size);
55
56 if (mapAddress == NULL) {
57 return NULL;
58 }
59
60 // commit memory
61 if (!os::commit_memory(mapAddress, size)) {
62 if (PrintMiscellaneous && Verbose) {
63 warning("Could not commit PerfData memory\n");
64 }
65 os::release_memory(mapAddress, size);
66 return NULL;
67 }
68
69 return mapAddress;
70 }
71
72 // delete the PerfData memory region
73 //
74 static void delete_standard_memory(char* addr, size_t size) {
75
76 // there are no persistent external resources to cleanup for standard
77 // memory. since DestroyJavaVM does not support unloading of the JVM,
78 // cleanup of the memory resource is not performed. The memory will be
79 // reclaimed by the OS upon termination of the process.
80 //
81 return;
|
1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
41
42 typedef BOOL (WINAPI *SetSecurityDescriptorControlFnPtr)(
43 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
44 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
45 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet);
46
47 // Standard Memory Implementation Details
48
49 // create the PerfData memory region in standard memory.
50 //
51 static char* create_standard_memory(size_t size) {
52
53 // allocate an aligned chuck of memory
54 char* mapAddress = os::reserve_memory(size);
55
56 if (mapAddress == NULL) {
57 return NULL;
58 }
59
60 // commit memory
61 if (!os::commit_memory(mapAddress, size, !ExecMem)) {
62 if (PrintMiscellaneous && Verbose) {
63 warning("Could not commit PerfData memory\n");
64 }
65 os::release_memory(mapAddress, size);
66 return NULL;
67 }
68
69 return mapAddress;
70 }
71
72 // delete the PerfData memory region
73 //
74 static void delete_standard_memory(char* addr, size_t size) {
75
76 // there are no persistent external resources to cleanup for standard
77 // memory. since DestroyJavaVM does not support unloading of the JVM,
78 // cleanup of the memory resource is not performed. The memory will be
79 // reclaimed by the OS upon termination of the process.
80 //
81 return;
|