-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #944 port newly modified changes from rel 3.6.3 to horace 4.0
- Loading branch information
Showing
3 changed files
with
44 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function [phys_memory,free_memory]=horace_memory() | ||
%HORACE_MEMORY Simple system-indepentent utility used by Horace to identify | ||
% its type for proper auto-configuration | ||
% | ||
% Returns: | ||
% phys_memory -- physical memory installed on the computer | ||
% free_memory -- free memory available for utilites. | ||
% Returns these parameters empty if the memory | ||
% identification does not work. | ||
|
||
if ispc | ||
[~,sys] = memory(); | ||
phys_memory = sys.PhysicalMemory.Total; | ||
free_memory = sys.PhysicalMemory.Available; | ||
elseif isunix | ||
[nok,mem_string] = system('free | grep Mem'); | ||
if nok | ||
phys_memory = []; | ||
free_memory = []; | ||
else | ||
[phys_memory,free_memory] = parse_mem_string(mem_string); | ||
end | ||
end | ||
|
||
function [phys_memory,free_memory] = parse_mem_string(mem_string) | ||
cont = regexp(mem_string,'\s+','split'); | ||
phys_memory = 1024*sscanf(cont{2},'%d'); | ||
free_memory = 1024*sscanf(cont{4},'%d'); |
This file was deleted.
Oops, something went wrong.