equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
161 char* addr = os::reserve_memory(size, NULL, alignment, flags); |
161 char* addr = os::reserve_memory(size, NULL, alignment, flags); |
162 if (addr == NULL) { |
162 if (addr == NULL) { |
163 return NULL; |
163 return NULL; |
164 } |
164 } |
165 |
165 |
166 if (os::commit_memory(addr, size, !ExecMem, "Allocator (commit)")) { |
166 if (os::commit_memory(addr, size, !ExecMem)) { |
167 return (E*)addr; |
167 return (E*)addr; |
168 } else { |
168 } else { |
169 os::release_memory(addr, size); |
169 os::release_memory(addr, size); |
170 return NULL; |
170 return NULL; |
171 } |
171 } |