rtl/generic.inc, minor optimizations:

* fpc_help_constructor: call platform-optimized version of FillChar directly instead of going through generic overloaded version.
* don't compile software multiplication routines if not necessary (the interface part already has similar $ifdef around)
* fpc_shortstr_append_shortstr: use sizeint instead of integer (the latter is 16-bit, produces less efficient code on most platforms)

git-svn-id: trunk@19727 -
This commit is contained in:
sergei 2011-12-02 20:55:53 +00:00
parent 32094761ef
commit 8dc6ebb5ed

View File

@ -752,7 +752,7 @@ begin
end;
if _self<>nil then
begin
fillchar(_self^,pvmt(vmtcopy)^.size,#0);
fillchar(_self^,pvmt(vmtcopy)^.size,0);
ppointer(_self+_vmt_pos)^:=vmtcopy;
end;
fpc_help_constructor:=_self;
@ -1025,7 +1025,7 @@ end;
procedure fpc_shortstr_append_shortstr(var s1:shortstring;const s2:shortstring);compilerproc;
[public,alias:'FPC_SHORTSTR_APPEND_SHORTSTR'];
var
s1l, s2l : integer;
s1l, s2l : sizeint;
begin
s1l:=length(s1);
s2l:=length(s2);
@ -1292,6 +1292,7 @@ end;
{****************************************************************************
Software multiplication
****************************************************************************}
{$ifdef FPC_INCLUDE_SOFTWARE_MUL}
{$ifndef FPC_SYSTEM_HAS_MUL_INTEGER}
function fpc_mul_integer(f1,f2 : integer;checkoverflow : boolean) : integer;[public,alias: 'FPC_MUL_INTEGER']; compilerproc;
@ -1447,6 +1448,8 @@ end;
end;
{$endif FPC_SYSTEM_HAS_MUL_DWORD}
{$endif FPC_INCLUDE_SOFTWARE_MUL}
{****************************************************************************
Software longint/dword division
****************************************************************************}