Skip to content

Commit 17fcc20

Browse files
committed
unload .NET
1 parent 7fca691 commit 17fcc20

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

+stdlib/is_wsl.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
fid = fopen('/proc/version');
1212
if fid >= 1
1313
v = fscanf(fid, '%s');
14-
if fclose(fid) ~= 0
15-
w = -1;
16-
elseif endsWith(v, "microsoft-standard-WSL2")
14+
fclose(fid);
15+
if endsWith(v, "microsoft-standard-WSL2")
1716
w = 2;
1817
elseif endsWith(v, "-Microsoft")
1918
w = 1;

+stdlib/ram_total.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
bytes = uint64(0);
1313

14-
% .NET is about 10 times SLOWER than Java
15-
if ispc() && ~stdlib.has_java() && stdlib.has_dotnet()
14+
15+
if ispc() && stdlib.has_dotnet()
16+
% about the same speed as the Java version below.
1617
h = NET.addAssembly('Microsoft.VisualBasic');
1718
ci = Microsoft.VisualBasic.Devices.ComputerInfo();
1819
bytes = ci.TotalPhysicalMemory;
19-
delete(h);
20+
delete(h)
2021
elseif stdlib.has_java()
2122
b = javaMethod("getOperatingSystemMXBean", "java.lang.management.ManagementFactory");
2223

0 commit comments

Comments
 (0)