Steve Litt via fpc-pascal schrieb am Di.,
30. Mai 2023, 21:57:
> I don't know about other operating systems, but on Linux a crashed
> program gives up all its memory, even leaked memory, upon termination,
> so I'm not sure why this attention to memory leak on abnormal
> termination is even necess
Michael Van Canneyt via fpc-pascal said on Tue, 30 May 2023 16:55:16
+0200 (CEST)
>On Tue, 30 May 2023, Hairy Pixels via fpc-pascal wrote:
>
>>
>>
>>> On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal
>>> wrote:
>>>
>>>
>>> In C you need to do something like this:
>>>
>>> Function
On Tue, 30 May 2023, Hairy Pixels via fpc-pascal wrote:
On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal
wrote:
In C you need to do something like this:
Function MyFunction(out theresult : TResultType) : Integer;
begin
Allocate A
...
error condition 1:
Free A, ex
> On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
>
> In C you need to do something like this:
>
> Function MyFunction(out theresult : TResultType) : Integer;
>
> begin
> Allocate A
> ...
> error condition 1:
>Free A, exit (1);
> ...
> Allocate B
> erro
s, it seems
ridiculous to discuss about 39 bytes!
- Original Message -
From: Benito van der Zander via fpc-pascal
To: fpc-pascal@lists.freepascal.org
Sent: Thursday, May 25, 2023, 22:49:08
Subject: [fpc-pascal] Freeing memory with exceptions
Hi,
> That 99.99% of people doe
Benito van der Zander via fpc-pascal said on Wed, 24 May 2023 13:00:04
+0200
>I regret installing Linux. Everything worked better with Windows 98
>and Delphi 4
Why not just take your Win98 install disk, install win98, then take
your Delphi 4 install disk, install Delphi 4, and you're all set. And
On Thu, 25 May 2023, Benito van der Zander via fpc-pascal wrote:
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
If people don't know there is overhead
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
Mattias Gaertner via fpc-pascal schrieb
am Do., 25. Mai 2023, 08:23:
> On Thu, 25 May 2023 07:55:39 +0200
> Sven Barth via fpc-pascal wrote:
>
> >[...]
> > But this is what "managed type" *means*: that the compiler and RTL
> > will make sure that it's correctly freed as long as nothing
> > unexp
On Thu, 25 May 2023 07:55:39 +0200
Sven Barth via fpc-pascal wrote:
>[...]
> But this is what "managed type" *means*: that the compiler and RTL
> will make sure that it's correctly freed as long as nothing
> unexpected happens.
... and exceptions are expected.
Maybe better: As long as the user
On Thu, 25 May 2023, Hairy Pixels via fpc-pascal wrote:
On May 24, 2023, at 8:46 PM, Michael Van Canneyt via fpc-pascal
wrote:
I see no problem, I am used to this.
This is Pascal, you need to manage your memory and hence your references, this
is true even in the absence of exceptions:
Hairy Pixels via fpc-pascal schrieb am
Do., 25. Mai 2023, 04:32:
>
>
> > On May 24, 2023, at 8:46 PM, Michael Van Canneyt via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > I see no problem, I am used to this.
> >
> > This is Pascal, you need to manage your memory and hence your
>
On Thu, 25 May 2023, Hairy Pixels via fpc-pascal wrote:
On May 24, 2023, at 10:11 PM, Sven Barth via fpc-pascal
wrote:
You must have $H+ on and those are AnsiStrings? Why is there exception handling
involved with AnsiString? I guess it needs this just in case an exception is
thrown so
Hairy Pixels via fpc-pascal schrieb am
Do., 25. Mai 2023, 04:26:
>
>
> > On May 24, 2023, at 10:11 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > You must have $H+ on and those are AnsiStrings? Why is there exception
> handling involved with AnsiString? I guess
> On May 24, 2023, at 8:46 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> I see no problem, I am used to this.
>
> This is Pascal, you need to manage your memory and hence your references,
> this is true even in the absence of exceptions: In your example you would
> also need to rememb
> On May 24, 2023, at 10:11 PM, Sven Barth via fpc-pascal
> wrote:
>
> You must have $H+ on and those are AnsiStrings? Why is there exception
> handling involved with AnsiString? I guess it needs this just in case an
> exception is thrown somewhere in the call stack?
>
> Because Ansi- and
Benito van der Zander via fpc-pascal
schrieb am Do., 25. Mai 2023, 00:15:
> Hi
>
>
> Then also run FPC/win32 in wine for a real comparison.
>
>
> Or perhaps against modern C++ on Linux would also be a real comparison
>
It wouldn't be, because that would compare two different languages. C++
doesn
Hi
Then also run FPC/win32 in wine for a real comparison.
Or perhaps against modern C++ on Linux would also be a real comparison
FPC could at least inline fpc_setjmp in fpc_pushexceptaddr to make it
only one function call.
These kinds of statements are counter-productive.
That is a v
Hairy Pixels via fpc-pascal schrieb am
Mi., 24. Mai 2023, 14:10:
> You must have $H+ on and those are AnsiStrings? Why is there exception
> handling involved with AnsiString? I guess it needs this just in case an
> exception is thrown somewhere in the call stack?
Because Ansi- and UnicodeString
On Wed, 24 May 2023, Hairy Pixels via fpc-pascal wrote:
On May 21, 2023, at 11:03 PM, Michael Van Canneyt via fpc-pascal
wrote:
They're used all over the place in the RTL and FCL, so you better take them
into account.
The compiler will do this wrapping anyway if you use ansistrings, so
> On May 21, 2023, at 11:03 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> They're used all over the place in the RTL and FCL, so you better take them
> into account.
>
> The compiler will do this wrapping anyway if you use ansistrings, so the
> approach with e.g. a generic record will
You must have $H+ on and those are AnsiStrings? Why is there exception handling
involved with AnsiString? I guess it needs this just in case an exception is
thrown somewhere in the call stack?
> On May 23, 2023, at 5:44 PM, Benito van der Zander via fpc-pascal
> wrote:
>
> Like take:
>
> pro
Benito van der Zander via fpc-pascal
schrieb am Mi., 24. Mai 2023, 13:00:
> Hi,
>
> It is weird that your code calls setjmp? Are you using a non Windows
> platform? Comparisons with Delphi should be done on Windows where the
> exception systems match. Apples to Apples please.
>
>
> It is FPC on
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 on Windows where
the exception systems match. Apples to Apples please.
It is FPC on Linux.
And Delphi 4 on
Hi,
It is weird that your code calls setjmp? Are you using a non Windows
platform? Comparisons with Delphi should be done on Windows where the
exception systems match. Apples to Apples please.
It is FPC on Linux.
And Delphi 4 on Linux (in WINE)
Even if it wants to do the Linux nonsense, FP
On 23-5-2023 12:44, Benito van der 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;
On Mon, 22 May 2023, Benito van der Zander via fpc-pascal wrote:
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 overhe
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
On Mon, 22 May 2023, Steve Litt via fpc-pascal wrote:
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15
+0200 (CEST)
On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote:
I've never really used exceptions myself in Pascal (with the
exception of breaking out of deeply
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15
+0200 (CEST)
>Assuming the result of A is not used outside of Test, the following is
>the only solution:
>
>procedure Test;
>
>var
> A : TObject;
>begin
> A:=TObject.Create;
> Try
> // call some code in other unit which
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15
+0200 (CEST)
>On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote:
>
>> I've never really used exceptions myself in Pascal (with the
>> exception of breaking out of deeply recursive function calls) so I
>> don't know all the r
On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote:
On May 21, 2023, at 2:47 PM, Michael Van Canneyt via fpc-pascal
wrote:
Your example will leak memory in any case, even if there is no exception,
since you're not freeing the object anywhere..
doh, dumb example on my behalf.
As
> On May 21, 2023, at 2:47 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> Your example will leak memory in any case, even if there is no exception,
> since you're not freeing the object anywhere..
doh, dumb example on my behalf.
>
> Assuming the result of A is not used outside of Test
On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote:
I've never really used exceptions myself in Pascal (with the exception of
breaking out of deeply recursive function calls) so I don't know all the rules.
In this example lets say you call Test() which allocates some memory and
then cal
I've never really used exceptions myself in Pascal (with the exception of
breaking out of deeply recursive function calls) so I don't know all the rules.
In this example lets say you call Test() which allocates some memory and then
calls out to another function in another unit which raises (the
35 matches
Mail list logo