Hi,
that is generating rather odd code (r40721)
project1.lpr:9 begin
00401090 55 push %rbp
00401091 4889e5 mov %rsp,%rbp
00401094 488d6424f0 lea -0x10(%rsp),%rsp
00401099 48895df
Hi,
I would definitely keep it that way.
As I see it: Redirection or not should not matter, the system should
assume console output.
Things like 'tee' make this concept dubious in any case:
If you pipe output to a program, you don't expect the codepage to change
because of the redirection.
Hi,
the line numbering of the json parser has been changed recently.
It used to say "Error at line 1"... when there was an error in the first
line, but now it says "Error at line 0"...
Was that on purpose, or can someone change it back?
Benito
___
here: https://bugs.freepascal.org/view.php?id=37836
On 29.09.20 10:47, Michael Van Canneyt via fpc-pascal wrote:
On Tue, 29 Sep 2020, Benito van der Zander via fpc-pascal wrote:
Hi,
the line numbering of the json parser has been changed recently.
It used to say "Error at line 1&quo
Hi,
there are also two lines in the json scanner where it tries to repair
numbers with leading dots '.123' to '0.123':
If (FCurTokenString[1]='.') then
FCurTokenString:='0'+FCurTokenString;
They should probably be removed. Not only are those numbers invalid in
json, it is a
Hi,
I am supposed to find invalid escape sequences when parsing JSON and
replace them with a user defined fallback. Invalid in the sense that the
unicode codepoint is not defined or a missing surrogate, not
syntactically invalid.
For example, any occurrence of \u and \uDEAD should be rep
They cannot be used on handles that do not support FileSeek()
(sockets, pipes, stdin/stdout etc.).
Well, it would be better if it could
You can just incrementally resize the return array, when reading
succeeds after seeking fails.
I have a string load function doing that:
https://git
Hi,
where do the SEARCH_DIRs in link.res come from?
My build has started failing, after trying it on a new computer with
"/home/benito/bin/arm-linux-androideabi-ld.bfd:android/libs/armeabi/link42815.res:17:
ignoring invalid character `'' in expression"
link.res starts with:
SEARCH_DIR(/hom
How are you specifying your cross-compilation sysroot? Make sure you use
the -XR parameter for that,
I use -Fl in ~/.fpc.cfg...
When I use -XR nothing happens. The link.res is the same, except -Fl
prepends the path to link.res and -XR just ignores it. (same for -Xr)
Benito
__
fpc-pascal wrote:
Op 2020-11-18 om 19:21 schreef Benito van der Zander via fpc-pascal:
where do the SEARCH_DIRs in link.res come from?
Some are hardcoded, and fpc.cfg might contain -Fl lines with paths too
from parsing ld.so.conf on install
___
Hi,
I also made such a thing:
var optionsreader: TCommandLineReader;
begin
optionsreader := TCommandLineReader.create;
optionsreader.declareFile('file', 'The file to be processed');
optionsreader.addAbbreviation('f');
optionsreader.declareFlag('help', '');
optionsreader.addAbbreviati
Hello,
this code:
program Project1;
{$mode objfpc}{$H+}
var a,b, c: string;
begin
a := 'x';
b := 'y';
SetCodePage(RawByteString(b), CP_NONE, false);
c := a+b;
writeln(c);
end.
prints x without y on win32/wine.
Is that supposed to happen?
Bye,
Benito
Hi,
perhaps a safe, generic function for this copying could be added to the
RTL. Like:
Procedure ManagedMove(const source: T;var dest: T;count: SizeInt);
a) For non-managed types it would be the same as Move(source, dest,
count*sizeof(T))
b) For reference counted types (like strings or i
+ n*k calls, which is around a third of 3*n*k
Bye,
Benito
On 11.01.21 18:51, Sven Barth via fpc-pascal wrote:
Benito van der Zander via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> schrieb am Mo., 11. Jan.
2021, 15:26:
Hi,
perhaps a safe, generic function for this co
strings before your code and then decrementing the reference
counts afterwards would probably work.
The same probably applies to other reference count objects.
Derek
On Thu, Jan 28, 2021 at 11:35 AM Benito van der Zander via fpc-pascal
<mailto:fpc-pascal@lists.freepascal.org>> wrote
There are no significant performance implications of interfaces.
They're essentially a virtual method call, something that one is doing
all day long with Object Pascal classes.
Interfaces are extremely slow. Virtual method calls are also slow. I
have been using interfaces for reference c
Hi,
If you need to create 1000 class instances each frame then you have a
flaw in your logic in my opinion.
I have more like a million class instances
For my XPath stuff, and every returned value is put in a variant-like
class. Selecting all nodes on an GB large XML, could even create almos
Hi,
And there often is a lot of unintentional deep copying. This is also
why a property returning a record is fairly useless except for
extremely small records like TPoint (and even that is not optimal no
But a managed record to replace an interface, would only contain a
single pointer/cla
6
8
With many small objects it should be faster just because it fits better
in the cache.
Cheers,
Benito
On 17.02.21 14:31, Marco van de Voort via fpc-pascal wrote:
Op 2021-02-17 om 00:02 schreef Benito van der Zander via fpc-pascal:
And there often is a lot of unintentional deep copying. This i
e back to the
class (sub $0x20,%rdi) before calling the actual method. Because the
class method assumes self is the class and not an interface
Bye,
Benito
On 17.02.21 17:37, Ryan Joseph via fpc-pascal wrote:
On Feb 17, 2021, at 8:27 AM, Benito van der Zander via fpc-pascal
wrote:
On 17.02.21 21:43, Ryan Joseph via fpc-pascal wrote:
So where is your 10% performance hit coming from then?
on init:
InitInterfacePointers or TInterfacedObject.AfterConstruction?
I benchmarked it years ago, I do not remember the details.
But InitInterfacePointers was bad. Just look at it:
Hi,
The problem is that, we like OOP inheritance but when we extend classes we are
forced into a single hierarchy.
there is another way to extend classes without inheritance: type helpers
Traits are like reverse type helpers. With the type helper you first
declare the class and then the ext
Hi,
xquery.internals.common.pas(434,80) Fatal: Cannot find PasDblStrUtils used by
xquery.internals.common of package internettools.
that is here: github.com/bero1985/pasdblstrutils
Download src/PasDblStrUtils.pas. Do not clone the repository when you
have a slow internet connection
It on
Hi,
If it is correct: Can we skip using ShortString buffer and have e.g.
'common' PChar base function for AnsiString/ShortString?
I keep arguing for that as well
You can always create such a function yourself, gain experience using
it, and share the source with us.
I wrote that for y
Hi,
I don’t see what the problem with a shortstring buffer is.. strtoint
could not make use of an input string longer than 256 characters
anyway, because the output integer could not have more than 19 digits
anyway.. so an input string longer than this would be useless… just
convert to a sho
Hallo,
I want to show how my program was compiled.
Now I have string like "FPC3.2.2 i386-Linux R+C+" from
compiler := 'FPC' + {$INCLUDE %FPCVERSION%} + ' ' + {$INCLUDE
%FPCTargetCPU%}+'-'+{$INCLUDE %FPCTargetOS%}+ ' ' + {$IfOpt
R+}+'R+'{$endif} {$IfOpt S+}+'S+'{$endif} {$IfOpt O+}+'O+'{$e
Hi,
Sort((left, right) begin
if left < right then
result := -1
else if left > right then
result := 1
else
result := 0;
end);
One could introduc
on every commit.
Best,
Benito
On 28.05.22 14:34, Tomas Hajny via fpc-pascal wrote:
On 2022-05-28 13:44, Benito van der Zander via fpc-pascal wrote:
Hi,
I want to show how my program was compiled.
Now I have string like "FPC3.2.2 i386-Linux R+C+" from
compiler := 'FPC'
Hi,
https://gitlab.com/freepascal.org/fpc/source/-/issues/38703
I'm afraid that with -O4 it is by design.
-O4 enables -OoUNCERTAIN, and the documentation about -OoUNCERTAIN
notes that:
“If uncertain optimizations are enabled, the CSE algorithm assumes that
— If something is written to a lo
Hallo,
why is a pointer to a char not a pchar (for type helpers)?
program Project1;
{$Mode objfpc}{$H+} {$ModeSwitch typehelpers}
type TPcharHelper = type helper for pchar
function toString(length: integer): string;
end;
function TPcharHelper.toString(length: integer): string;
begin
SetStr
Hi,
The compiler will do this wrapping anyway if you use ansistrings, so the
approach with e.g. a generic record will not cause a lot of overhead
in most
cases.
But using strings or anything similar causes a lot of overhead
It is really bad
Bye,
Benito
On 21.05.23 18:03, Michael Van Can
Zander via fpc-pascal wrote:
Hi,
Depends on your code.
I wrote all my code in Delphi 4. From 1998 or so. I do not make new
projects, only maintain old ones.
Delphi 4 felt much better.
Like take:
procedure test;
var s: string;
begin
s:= 'abc';
end;
It is weird that your
very productive optimization idea
Cheers,
Benito
On 24.05.23 13:10, Marco van de Voort via fpc-pascal wrote:
On 24-5-2023 13:00, Benito van der Zander via fpc-pascal wrote:
It is weird that your code calls setjmp? Are you using a non Windows
platform? Comparisons with Delphi should be done
Hi,
That 99.99% of people does use it, indicates they simply take the
overhead because
of the advantages that the managed types offer.
Or they simply do not know about the overhead
Like I was writing all my code on Windows 98, and never noticed any
overhead, until I started running benchm
Hallo,
i tried to run my program under LLVM (from july fpc) and it crashes?
Program received signal SIGSEGV, Segmentation fault.
0x0042e5f1in SYSTEM_$$_SYSGETMEM_FIXED$QWORD$$POINTER()
(gdb) bt
#0 0x0042e5f1in SYSTEM_$$_SYSGETMEM_FIXED$QWORD$$POINTER()
#1 0x0041b92ain fp
Hallo,
I tried to use the LLVM Link-Time-Optimization, -Clflto
I compiled/installed fpc llvm with a separate prefix, which was already
difficult to set up
Then the default linker did not want to link it.
The wiki says to use the gold linker. I do not know how to change the
linker in fpc.cfg
,
Benito
On 11.08.23 12:46, Jonas Maebe via fpc-pascal wrote:
On 10/08/2023 17:06, Benito van der Zander via fpc-pascal wrote:
I tried to use the LLVM Link-Time-Optimization, -Clflto
I should update the wiki page. Under Debian 11, I can tell FPC to use
gold with lto by specifying the following
writing this mail)
Then this:
https://gitlab.com/freepascal.org/fpc/source/-/issues/40280 is causing a
stack corruption
https://gitlab.com/freepascal.org/fpc/source/-/issues/40392 is causing a
heap corruption
Cheers,
Benito
On 11.08.23 12:57, Jonas Maebe via fpc-pascal wrote:
On 10/08/2023
Hi,
This field was introduced for Delphi compatibility:
The implementation of TMonitor requires this data.
Delphi has this field as well but "hides" the field behind all other
actually declared fields.
If you examine the actual memory size allocated for TObject, you'll
see that an extra fi
39 matches
Mail list logo