From e4ff553c121e29c497336fdde705e70d0abdc826 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Wed, 16 Oct 2024 07:05:17 +0000 Subject: [PATCH] 8341931: os_linux gtest uses lambdas with explicit capture lists Reviewed-by: jwaters, jsjolen --- test/hotspot/gtest/runtime/test_os_linux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/gtest/runtime/test_os_linux.cpp b/test/hotspot/gtest/runtime/test_os_linux.cpp index 387940afdf2..77b83ac1bd7 100644 --- a/test/hotspot/gtest/runtime/test_os_linux.cpp +++ b/test/hotspot/gtest/runtime/test_os_linux.cpp @@ -360,10 +360,10 @@ TEST_VM(os_linux, pretouch_thp_and_use_concurrent) { EXPECT_TRUE(os::commit_memory(heap, size, false)); { - auto pretouch = [heap](Thread*, int) { + auto pretouch = [&](Thread*, int) { os::pretouch_memory(heap, heap + size, os::vm_page_size()); }; - auto useMemory = [heap](Thread*, int) { + auto useMemory = [&](Thread*, int) { int* iptr = reinterpret_cast(heap); for (int i = 0; i < 1000; i++) *iptr++ = i; };