Skip to content

Commit eb1a58b

Browse files
committed
[GR-46536] Add jdk.internal.platform to built-in package natives.
PullRequest: graal/14764
2 parents f8a47c9 + ec0dd7f commit eb1a58b

File tree

4 files changed

+5
-110
lines changed

4 files changed

+5
-110
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CgroupMetricsJDK.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/HasGetTotalMemorySize0.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/PlatformNativeLibrarySupport.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -65,10 +65,11 @@ public abstract class PlatformNativeLibrarySupport {
6565
"javax_net",
6666
"javax_script",
6767
"javax_security",
68-
"jdk_internal_org",
68+
"jdk_internal_jimage",
6969
"jdk_internal_misc",
70+
"jdk_internal_org",
71+
"jdk_internal_platform",
7072
"jdk_internal_util",
71-
"jdk_internal_jimage",
7273
"jdk_internal_vm",
7374
"jdk_net",
7475
"sun_invoke",

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_platform_CgroupMetrics.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,17 @@
2626

2727
import static com.oracle.svm.core.Containers.Options.UseContainerSupport;
2828

29-
import org.graalvm.nativeimage.ImageSingletons;
3029
import org.graalvm.nativeimage.Platform;
3130
import org.graalvm.nativeimage.Platforms;
3231

3332
import com.oracle.svm.core.annotate.Substitute;
3433
import com.oracle.svm.core.annotate.TargetClass;
35-
import com.oracle.svm.core.annotate.TargetElement;
36-
import com.oracle.svm.core.heap.PhysicalMemory.PhysicalMemorySupport;
3734

3835
@Platforms(Platform.LINUX.class)
39-
@TargetClass(className = "jdk.internal.platform.CgroupMetrics", onlyWith = CgroupMetricsJDK.class)
36+
@TargetClass(className = "jdk.internal.platform.CgroupMetrics")
4037
public final class Target_jdk_internal_platform_CgroupMetrics {
4138
@Substitute
4239
public static boolean isUseContainerSupport() {
4340
return UseContainerSupport.getValue();
4441
}
45-
46-
@Substitute
47-
@TargetElement(onlyWith = HasGetTotalMemorySize0.class)
48-
public static long getTotalMemorySize0() {
49-
// We ought not to use PhysicalMemory.size() here since that might return the
50-
// container memory which we explicitly want to avoid for this method. It serves
51-
// as an upper bound of the container memory.
52-
return ImageSingletons.lookup(PhysicalMemorySupport.class).size().rawValue();
53-
}
5442
}

0 commit comments

Comments
 (0)