Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2004-04

fcl, classes unit, memory issue

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rimgaudas Laucius

Hello,

uses
  classes;
var
  l: tstringlist;
begin
  l.loadfromfile('file.txt'); //<-hangs here
  ...
end.

Program hangs (under windows, 1.9.2 and earlier v.) then i try to load relatively large file (~7 MB) without raising any error message. It works ok, if i set more memory using directive ($M). Why do not program allocate neaded memory automaticaly? Do i need to calculate how much memory need to program and set its size before compilation always?

Reply by email

Michael Van Canneyt
to Rimgaudas Laucius
Rimgaudas Laucius wrote 12 lines
Hello, uses classes; var l: tstringlist; begin l.loadfromfile('file.txt'); //<-hangs here ... end. Program hangs (under windows, 1.9.2 and earlier v.) then i try to load relatively large file (~7 MB) without raising any error message. It works ok, if i set more memory using directive ($M). Why do not program allocate neaded memory automaticaly? Do i need to calculate how much memory need to program and set its size before compilation always?

No. Are you sure it hangs ? My guess is that it is simply working very hard. It only allocates a 1K buffer to load the file, so that should not be the issue.

Michael.

Reply by email

Rimgaudas Laucius
to Michael Van Canneyt

----- Original Message -----

Earlier message 41 lines
From: "Michael Van Canneyt" To: Sent: Monday, April 19, 2004 11:23 AM Subject: Re: [fpc-devel]fcl, classes unit, memory issue > > > On Sun, 18 Apr 2004, Rimgaudas Laucius wrote: > > > Hello, > > > > uses > > classes; > > var > > l: tstringlist; > > begin > > l.loadfromfile('file.txt'); //<-hangs here > > ... > > end. > > > > Program hangs (under windows, 1.9.2 and earlier v.) then i try to load relatively large file (~7 MB) without raising any error message. It works ok, if i set more memory using directive ($M). Why do not program allocate neaded memory automaticaly? Do i need to calculate how much memory need to program and set its size before compilation always? > > No. Are you sure it hangs ? My guess is that it is simply working very > hard. It only allocates a 1K buffer to load the file, so that should not > be the issue. Yes i am sure. I registered it as issue 3059 with "working" example. > > Michael. > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel >

Reply by email

Ozerski Pavel
to Rimgaudas Laucius

I submitted a bug in the FPC bug list (as #3061).
I would discuss it a little because now I write a stuff to radically solve problems with indexes export. Maybe, these two problems need to be solved as one complex? But I'm understandig that big changes in the compiler code may cause new problems.

Sincerely, Pavel.

Description:
FPC doesn't support exports clause in units. That breaks Delphi compatibility and may cause serious problems by writing or porting big library projects.

{ Source provided for Free Pascal Bug Report 3061 }
{ Submitted by "Pavel V. Ozerski" on  2004-04-22 }
{ e-mail:  }
unit unit1;
interface
implementation
procedure MyProc;
 begin
 end;
exports
 MyProc name 'MyProc';
end.
library myLib;
uses
 unit1;
begin
end.

Reply by email

Peter Vreman
to Ozerski Pavel
Show quoted text 5 lines
I submitted a bug in the FPC bug list (as #3061). I would discuss it a little because now I write a stuff to radically solve problems with indexes export. Maybe, these two problems need to be solved as one complex? But I'm understandig that big changes in the compiler code may cause new problems.

I don't think that it creates new problems. It is a part of the compiler that is rather independent from other functionality. If you can are working on a fix please take also a look at the next problem reports:

2248 Unfixed Error Delphi error load DLL creates in FPC 2297 Unfixed Error export from dll
2363 Unfixed Error export problem
2364 Unfixed Error exports in unit
2366 Unfixed Error DLL generation - index numbers
2368 Unfixed Error DLL generation - Win32

Reply by email