소스 검색

- Remove usage of memory unit; things like the lowmemory function are
flawed for the same reason memavail is flawed.

git-svn-id: trunk@2720 -

daniel 19 년 전
부모
커밋
df70410e9c
5개의 변경된 파일31개의 추가작업 그리고 23개의 파일을 삭제
  1. 11 9
      fv/app.pas
  2. 1 1
      fv/buildfv.pas
  3. 3 1
      fv/resource.pas
  4. 13 9
      fv/stddlg.pas
  5. 3 3
      ide/fpide.pas

+ 11 - 9
fv/app.pas

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

+ 1 - 1
fv/buildfv.pas

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

+ 3 - 1
fv/resource.pas

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

+ 13 - 9
fv/stddlg.pas

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

+ 3 - 3
ide/fpide.pas

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