S
soarsoft
Unregistered / Unconfirmed
GUEST, unregistred user!
用DecisionCube在有些机器中会出现:The DecisionCube capacity is low..提示,如何解决?
找到下面代码,但看不懂,请教各位了....
http://www.delphibbs.com/keylife/iblog_show.asp?xid=23004
KeyLife富翁笔记
作者?: moshengren2000
标题?: 解决DecisionCube “The DecisionCube capacity is low”的 bug的代码
关键字: DecisionCube bug
分类?: 开发技巧
密级?: 公开
(评分: , 回复: 0, 阅读: 1024) »»
unit DecisionCubeBugWorkaround;
interface
uses Windows, Mxarrays;
implementation
function GetAvailableMem: Integer;
const
MaxInt: Int64 = High(Integer);
var
MemStats: TMemoryStatus;
Available: Int64;
begin
GlobalMemoryStatus(MemStats);
if (MemStats.dwAvailPhys > MaxInt) or (Longint(MemStats.dwAvailPhys) = -1) then
Available := MaxInt
else
Available := MemStats.dwAvailPhys;
if (MemStats.dwAvailPageFile > MaxInt) or (Longint(MemStats.dwAvailPageFile) = -1) then
Inc(Available, MaxInt div 2)
else
Inc(Available, MemStats.dwAvailPageFile div 2);
if Available > MaxInt then
Result := MaxInt
else
Result := Available;
end;
initialization
Mxarrays.SetMemoryCapacity(GetAvailableMem);
end.
找到下面代码,但看不懂,请教各位了....
http://www.delphibbs.com/keylife/iblog_show.asp?xid=23004
KeyLife富翁笔记
作者?: moshengren2000
标题?: 解决DecisionCube “The DecisionCube capacity is low”的 bug的代码
关键字: DecisionCube bug
分类?: 开发技巧
密级?: 公开
(评分: , 回复: 0, 阅读: 1024) »»
unit DecisionCubeBugWorkaround;
interface
uses Windows, Mxarrays;
implementation
function GetAvailableMem: Integer;
const
MaxInt: Int64 = High(Integer);
var
MemStats: TMemoryStatus;
Available: Int64;
begin
GlobalMemoryStatus(MemStats);
if (MemStats.dwAvailPhys > MaxInt) or (Longint(MemStats.dwAvailPhys) = -1) then
Available := MaxInt
else
Available := MemStats.dwAvailPhys;
if (MemStats.dwAvailPageFile > MaxInt) or (Longint(MemStats.dwAvailPageFile) = -1) then
Inc(Available, MaxInt div 2)
else
Inc(Available, MemStats.dwAvailPageFile div 2);
if Available > MaxInt then
Result := MaxInt
else
Result := Available;
end;
initialization
Mxarrays.SetMemoryCapacity(GetAvailableMem);
end.