Sign in Join

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

Mailing lists / fpc-devel / 2000-09

Message *bounced*

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

O/T-Track+ 2.66b

************************************************************************ *** WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING *** ************************************************************************ *
* The e-mail-message appended below is list- or mailserver-related *
* That type of mail will by definition not be processed on this system
* and in general is not accepted in the fidonet.org-domain. *
* To avoid these bouncings the listkeeper is kindly requested to
* remove any subscription coming from a z2.fidonet.org-style address. *
* If you have reason to believe your message was removed without due
* reason then kindly inform ''.
*
************************************************************************

From: Pavel V. Ozerski @2:292/862
To: fpc-develop @2:5020/1305.201
Subj.: [fpc-devel]Why is it so complex and heavy?
Dated: 05 Sep 00 15:19:10
[processed here: 06 Sep 00 09:58:37]

@TOPT 201
@INTL 2:5020/1305 2:292/862
@MSGID: insect.mail.iephb.ru 3e4f0c47
@REPLYADDR:
@REPLYTO: UUCP
@PID: dMail [Demos Mail for Windows NT v1.4b1]
@CHRS: LATIN-1 2
@RFC-Received: from vekoll.saturnus.vein.hu (
[193.6.40.1]) by infomag.iguana.be (8.9.3/8.9.3) with ESMTP id UAA16370 for ; Tue, 5 Sep 2000 20:46:58 +0200
@RFC-Received: from vekoll.saturnus.vein.hu ( [127.0.0.1]) by vekoll.saturnus.vein.hu (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id PAA30410; Tue, 5 Sep 2000 15:18:17 +0200
@RFC-Received: from dns.iephb.ru (iepb.pu.ru [195.70.201.1]) by vekoll.saturnus.vein.hu (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id PAA30396 for ; Tue, 5 Sep 2000 15:18:05 +0200
@RFC-X-Authentication-Warning: vekoll.saturnus.vein.hu: Host iepb.pu.ru [195.70.201.1] claimed to be dns.iephb.ru
@RFC-Received: from insect.UUCP () by dns.iephb.ru (8.9.3/8.9.3/krok-cf-2.0) with UUCP id RAA21773 for ; Tue, 5 Sep 2000 17:17:29 +0400 (MSD)
@RFC-Received: by insect.mail.iephb.ru (dMail for Windows NT v1.4b1, 05Dec96); Tue, 5 Sep 2000 17:19:10 +0400
@RFC-References:
@RFC-Organization: Sechenov Institute of Evolutionary Physiology and Biochemistry, Russian Academy of Science
@RFC-Message-Id:
@RFC-Sender:
@RFC-Errors-To:
@RFC-X-Mailman-Version: 1.0rc2
@RFC-List-Id: FPC developers' list <fpc-devel.lists.freepascal.org> @RFC-X-BeenThere:
To:
From: (Pavel V. Ozerski)
Reply-To:

Hello,

I have an idea. I looked into objpas.pp source code and found that some system functions existing for Delphi compatibility
are written simply but not very smartly.

Example:

Procedure AssignFile(Var f:File;const Name:string);
begin
  System.Assign (F,Name);
end;

If I write a program which uses this function, this program will call AssignFile at first stage, then AssignFile will call Assign. While these processes some useless operations will be executed: two callings and returns instead one and also additional stack
operations. This circumstance must slow program running and bloat their code. Therefore I suggest to make some tricks.
1) Change assign and close procedures in file.inc a little like in followed example:

Procedure Assign(var f:File;const Name:string);
 [public,alias:'assign_file_string']; // My change is only this additional
line!
{
  Assign Name to file f so it can be used with the file routines
}
Begin
  FillChar(f,SizeOf(FileRec),0);
  FileRec(f).Handle:=UnusedHandle;
  FileRec(f).mode:=fmClosed;
  Move(Name[1],FileRec(f).Name,Length(Name));
End;

2) Accordingly, all AssignFile and CloseFile procedures in objpas.pp can be changed like followed example:

     Procedure AssignFile(Var f:File;const Name:string);external name
'assign_file_string';

At result directly Assign and Close instead Assignfile and Closefile will be linked.

I did not tested this idea but hope that it does not contain errors or problems.

Pavel

Reply by email