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 */
23
24 #include "precompiled.hpp"
25
26 #ifdef _WINDOWS
27
28 #include "runtime/os.hpp"
29 #include "runtime/flags/flagSetting.hpp"
30 #include "unittest.hpp"
31
32 namespace {
33 class MemoryReleaser {
34 char* const _ptr;
35 const size_t _size;
36 public:
37 MemoryReleaser(char* ptr, size_t size) : _ptr(ptr), _size(size) { }
38 ~MemoryReleaser() {
39 os::release_memory_special(_ptr, _size);
40 }
41 };
42 }
43
44 // test tries to allocate memory in a single contiguous memory block at a particular address.
45 // The test first tries to find a good approximate address to allocate at by using the same
46 // method to allocate some memory at any address. The test then tries to allocate memory in
47 // the vicinity (not directly after it to avoid possible by-chance use of that location)
48 // This is of course only some dodgy assumption, there is no guarantee that the vicinity of
49 // the previously allocated memory is available for allocation. The only actual failure
|
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 */
23
24 #include "precompiled.hpp"
25
26 #ifdef _WINDOWS
27
28 #include "runtime/os.hpp"
29 #include "runtime/flags/flagSetting.hpp"
30 #include "runtime/globals_extension.hpp"
31 #include "unittest.hpp"
32
33 namespace {
34 class MemoryReleaser {
35 char* const _ptr;
36 const size_t _size;
37 public:
38 MemoryReleaser(char* ptr, size_t size) : _ptr(ptr), _size(size) { }
39 ~MemoryReleaser() {
40 os::release_memory_special(_ptr, _size);
41 }
42 };
43 }
44
45 // test tries to allocate memory in a single contiguous memory block at a particular address.
46 // The test first tries to find a good approximate address to allocate at by using the same
47 // method to allocate some memory at any address. The test then tries to allocate memory in
48 // the vicinity (not directly after it to avoid possible by-chance use of that location)
49 // This is of course only some dodgy assumption, there is no guarantee that the vicinity of
50 // the previously allocated memory is available for allocation. The only actual failure
|