- Remove usage of memory unit; things like the lowmemory function are

flawed for the same reason memavail is flawed.

git-svn-id: trunk@2720 -
This commit is contained in:
daniel 2006-03-01 15:29:05 +00:00
parent 2dd2bce892
commit df70410e9c
5 changed files with 31 additions and 23 deletions

View File

@ -59,7 +59,7 @@ USES
{$ENDIF} {$ENDIF}
Dos, Dos,
Video, Video,
FVCommon, Memory, { GFV standard units } FVCommon, {Memory,} { GFV standard units }
Objects, Drivers, Views, Menus, HistList, Dialogs, Objects, Drivers, Views, Menus, HistList, Dialogs,
msgbox, fvconsts; msgbox, fvconsts;
@ -716,11 +716,13 @@ FUNCTION TProgram.ValidView (P: PView): PView;
BEGIN BEGIN
ValidView := Nil; { Preset failure } ValidView := Nil; { Preset failure }
If (P <> Nil) Then Begin If (P <> Nil) Then Begin
(*
If LowMemory Then Begin { Check memroy } If LowMemory Then Begin { Check memroy }
Dispose(P, Done); { Dispose view } Dispose(P, Done); { Dispose view }
OutOfMemory; { Call out of memory } OutOfMemory; { Call out of memory }
Exit; { Now exit } Exit; { Now exit }
End; End;
*)
If NOT P^.Valid(cmValid) Then Begin { Check view valid } If NOT P^.Valid(cmValid) Then Begin { Check view valid }
Dispose(P, Done); { Dipose view } Dispose(P, Done); { Dipose view }
Exit; { Now exit } Exit; { Now exit }
@ -866,8 +868,8 @@ var
R: TRect; R: TRect;
begin begin
HideMouse; HideMouse;
DoneMemory; { DoneMemory;}
InitMemory; { InitMemory;}
InitScreen; InitScreen;
Buffer := Views.PVideoBuf(VideoBuf); Buffer := Views.PVideoBuf(VideoBuf);
R.Assign(0, 0, ScreenWidth, ScreenHeight); R.Assign(0, 0, ScreenWidth, ScreenHeight);
@ -880,10 +882,10 @@ var
R: TRect; R: TRect;
begin begin
DoneMouse; DoneMouse;
DoneMemory; { DoneMemory;}
ScreenMode:=Mode; ScreenMode:=Mode;
InitMouse; InitMouse;
InitMemory; { InitMemory;}
InitScreen; InitScreen;
Video.SetVideoMode(Mode); Video.SetVideoMode(Mode);
Buffer := Views.PVideoBuf(VideoBuf); Buffer := Views.PVideoBuf(VideoBuf);
@ -963,7 +965,7 @@ END;
{---------------------------------------------------------------------------} {---------------------------------------------------------------------------}
CONSTRUCTOR TApplication.Init; CONSTRUCTOR TApplication.Init;
BEGIN BEGIN
InitMemory; { Start memory up } { InitMemory;} { Start memory up }
Drivers.InitVideo; { Start video up } Drivers.InitVideo; { Start video up }
Drivers.InitEvents; { Start event drive } Drivers.InitEvents; { Start event drive }
Drivers.InitSysError; { Start system error } Drivers.InitSysError; { Start system error }
@ -987,7 +989,7 @@ BEGIN
Drivers.DoneSysError; { Close system error } Drivers.DoneSysError; { Close system error }
Drivers.DoneEvents; { Close event drive } Drivers.DoneEvents; { Close event drive }
DoneScreen; DoneScreen;
DoneMemory; { Close memory } { DoneMemory;} { Close memory }
END; END;
{--TApplication-------------------------------------------------------------} {--TApplication-------------------------------------------------------------}
@ -1018,12 +1020,12 @@ BEGIN { Compatability only }
DoneSysError; DoneSysError;
DoneEvents; DoneEvents;
DoneScreen; DoneScreen;
DoneDosMem; { DoneDosMem;}
WriteShellMsg; WriteShellMsg;
SwapVectors; SwapVectors;
Exec(GetEnv('COMSPEC'), ''); Exec(GetEnv('COMSPEC'), '');
SwapVectors; SwapVectors;
InitDosMem; { InitDosMem;}
InitScreen; InitScreen;
InitEvents; InitEvents;
InitSysError; InitSysError;

View File

@ -8,7 +8,7 @@ uses
fvcommon, fvcommon,
objects, objects,
drivers, drivers,
memory, { memory,}
fvconsts, fvconsts,
resource, resource,
views, views,

View File

@ -279,7 +279,7 @@ implementation
{****************************************************************************} {****************************************************************************}
uses uses
Memory, Drivers; {Memory, }Drivers;
{****************************************************************************} {****************************************************************************}
{ TConstant object } { TConstant object }
@ -479,6 +479,7 @@ begin
begin begin
MakeEditableString(S); MakeEditableString(S);
Constant := NewConstant(i,S); Constant := NewConstant(i,S);
(*
if LowMemory then if LowMemory then
begin begin
if (Constant <> nil) then if (Constant <> nil) then
@ -486,6 +487,7 @@ begin
LoadStrings := 8; { out of memory } LoadStrings := 8; { out of memory }
Exit; Exit;
end; end;
*)
Insert(Constant); Insert(Constant);
end; end;
end; end;

View File

@ -560,7 +560,7 @@ implementation
{****************************************************************************} {****************************************************************************}
uses uses
App, Memory, HistList, MsgBox, Resource; App, {Memory,} HistList, MsgBox, Resource;
type type
@ -1019,15 +1019,16 @@ begin
if (S.Attr and Directory = 0) and if (S.Attr and Directory = 0) and
MatchesMaskList(S.Name,WildName) then MatchesMaskList(S.Name,WildName) then
begin begin
P := MemAlloc(SizeOf(P^)); { P := MemAlloc(SizeOf(P^));
if assigned(P) then if assigned(P) then
begin begin}
new(P);
P^.Attr:=S.Attr; P^.Attr:=S.Attr;
P^.Time:=S.Time; P^.Time:=S.Time;
P^.Size:=S.Size; P^.Size:=S.Size;
P^.Name:=S.Name; P^.Name:=S.Name;
FileList^.Insert(P); FileList^.Insert(P);
end; { end;}
end; end;
FindNext(S); FindNext(S);
end; end;
@ -1041,15 +1042,16 @@ begin
begin begin
if (S.Attr and Directory <> 0) and (S.Name <> '.') and (S.Name <> '..') then if (S.Attr and Directory <> 0) and (S.Name <> '.') and (S.Name <> '..') then
begin begin
P := MemAlloc(SizeOf(P^)); { P := MemAlloc(SizeOf(P^));
if P <> nil then if P <> nil then
begin begin}
new(p);
P^.Attr:=S.Attr; P^.Attr:=S.Attr;
P^.Time:=S.Time; P^.Time:=S.Time;
P^.Size:=S.Size; P^.Size:=S.Size;
P^.Name:=S.Name; P^.Name:=S.Name;
FileList^.Insert(P); FileList^.Insert(P);
end; { end;}
end; end;
FindNext(S); FindNext(S);
end; end;
@ -1060,9 +1062,11 @@ begin
if Length(Dir) > 4 then if Length(Dir) > 4 then
{$endif not Unix} {$endif not Unix}
begin begin
{
P := MemAlloc(SizeOf(P^)); P := MemAlloc(SizeOf(P^));
if P <> nil then if P <> nil then
begin begin}
new(p);
FindFirst(Tmp, Directory, S); FindFirst(Tmp, Directory, S);
FindNext(S); FindNext(S);
if (DosError = 0) and (S.Name = PrevDir) then if (DosError = 0) and (S.Name = PrevDir) then
@ -1083,7 +1087,7 @@ begin
{$ifdef fpc} {$ifdef fpc}
FindClose(S); FindClose(S);
{$endif} {$endif}
end; { end;}
end; end;
if P = nil then if P = nil then
MessageBox(strings^.get(sTooManyFiles), nil, mfOkButton + mfWarning); MessageBox(strings^.get(sTooManyFiles), nil, mfOkButton + mfWarning);

View File

@ -180,7 +180,7 @@ uses
Video,Mouse,Keyboard, Video,Mouse,Keyboard,
Compiler,Version, Compiler,Version,
FVConsts, FVConsts,
Dos,Memory,Menus,Dialogs,StdDlg,timeddlg, Dos{,Memory},Menus,Dialogs,StdDlg,timeddlg,
Systems, Systems,
WUtils,WHlpView,WViews,WHTMLHlp,WHelp,WConsole, WUtils,WHlpView,WViews,WHTMLHlp,WHelp,WConsole,
FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp, FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
@ -887,7 +887,7 @@ begin
DoneMouse DoneMouse
else else
ButtonCount:=0; ButtonCount:=0;
DoneDosMem; { DoneDosMem;}
if Assigned(UserScreen) then if Assigned(UserScreen) then
UserScreen^.SwitchToConsoleScreen; UserScreen^.SwitchToConsoleScreen;
@ -898,7 +898,7 @@ procedure TIDEApp.ShowIDEScreen;
begin begin
if Assigned(UserScreen) then if Assigned(UserScreen) then
UserScreen^.SaveConsoleScreen; UserScreen^.SaveConsoleScreen;
InitDosMem; { InitDosMem;}
InitKeyboard; InitKeyboard;
If UseMouse then If UseMouse then
InitMouse InitMouse