* make StdOut/StdErr optionally a true alias of Output/ErrOutput, so they share the same underlying TextRec. this reduces data segment usage on small systems by more than 1K.

git-svn-id: trunk@38196 -
This commit is contained in:
Károly Balogh 2018-02-10 22:45:51 +00:00
parent 980c689d37
commit 07513150e0
2 changed files with 12 additions and 1 deletions

View File

@ -1012,10 +1012,12 @@ begin
Flush(Output); Flush(Output);
if Textrec(ErrOutput).Mode=fmOutput then if Textrec(ErrOutput).Mode=fmOutput then
Flush(ErrOutput); Flush(ErrOutput);
{$ifndef FPC_STDOUT_TRUE_ALIAS}
if Textrec(stdout).Mode=fmOutput then if Textrec(stdout).Mode=fmOutput then
Flush(stdout); Flush(stdout);
if Textrec(StdErr).Mode=fmOutput then if Textrec(StdErr).Mode=fmOutput then
Flush(StdErr); Flush(StdErr);
{$endif FPC_STDOUT_TRUE_ALIAS}
end; end;
{$endif FPC_HAS_FEATURE_CONSOLEIO} {$endif FPC_HAS_FEATURE_CONSOLEIO}

View File

@ -766,9 +766,18 @@ Var
{ Standard In- and Output } { Standard In- and Output }
ErrOutput, ErrOutput,
Output, Output,
Input, Input : Text;
{$ifndef FPC_STDOUT_TRUE_ALIAS}
StdOut, StdOut,
StdErr : Text; StdErr : Text;
{$else FPC_STDOUT_TRUE_ALIAS}
{ Optionally, make StdOut and StdErr a true alias of Output
and ErrOutput. This is benefical on small systems where the
data segment size is limited, as it lessens the RTL's data
size by a bit more than 1K. }
StdOut : Text Absolute Output;
StdErr : Text Absolute ErrOutput;
{$endif FPC_STDOUT_TRUE_ALIAS}
InOutRes : Word; InOutRes : Word;
{ Stack checking } { Stack checking }
StackBottom : Pointer; StackBottom : Pointer;