-
Content Count
1518 -
Joined
-
Last visited
-
Days Won
154
Everything posted by Stefan Glienke
-
Conditional compilation for various Delphi versions
Stefan Glienke replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
If possible - often enough you ifdef because of bugs or workarounds. I usually ifdef using the defines from jedi.inc and put a comment to the reported issue that I ifdef for. -
RTTI and EXE file size: how to shrink your executable 2 times
Stefan Glienke replied to Kryvich's topic in RTL and Delphi Object Pascal
Your question shows your lack of knowledge on the topic (I don't mean that in any form negative) so I suggest you should not mess with it. RTTI is queried with code that executes at runtime and thus can only cause errors at runtime. And even if you in your code don't explicitly make use of RTTI that does not mean that any other part might not do it (either third party or even RTL). Want to serialize some object to JSON and use System.Json - ohh, will not work if you did disable RTTI (just one example). So unless you really have a problem because of binary size (and no, we are most likely not in a 64k demo scene competition here) then apply the first rule of optimization by Michael A. Jackson: "Don't do it."- 16 replies
-
RTTI and EXE file size: how to shrink your executable 2 times
Stefan Glienke replied to Kryvich's topic in RTL and Delphi Object Pascal
The R in RTTI is for runtime - now please guess š- 16 replies
-
Has the migration tool EVER worked for you?
Stefan Glienke replied to Tom F's topic in Delphi IDE and APIs
Eye candy goes hand in hand with UX. If the usability sucks people will notice. If the UX is great but the UI is a bit dated people that are actually using it won't complain (much) but new users might pass by just because the first impression is not great visually. If all you got though is eye candy it might draw people but then let them down by crappy UX. -
Speed up reading multiple text files
Stefan Glienke replied to dummzeuch's topic in RTL and Delphi Object Pascal
System.Diagnostics.TStopwatch -
If _UStrArrayClr is giving you an AV I am putting all my money on passing something wrong somewhere and destroying it's reference counter causing a premature FreeMem or something similar.
-
ScaleMM2 with MARS: +70% performance boost :-)
Stefan Glienke replied to Andrea Magni's topic in MARS-Curiosity REST Library
It's easy enough to profile where the mass of heap allocations are coming from by using FastMM full debug and log the callstacks. Or run under SamplingProfiler and check what hits the memory routines most. -
Rio has a broken REST Library
Stefan Glienke replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
@Attila Kovacs Your quote from the help is kinda misleading because the code path there is the one handling the function not succeeding but returning ERROR_INSUFFICIENT_BUFFER. @Kryvich The help combined with the code below is confusing me. It says number of bytes but then it also does a dwSize/sizeof(WCHAR) to allocate a wchar array š -
Delphi Bugs reported to QualityPortal
Stefan Glienke replied to Lars Fosdal's topic in Community Management
If you're interested, look there - otherwise too much noise for a forum imo. -
Delphi Bugs reported to QualityPortal
Stefan Glienke replied to Lars Fosdal's topic in Community Management
https://quality.embarcadero.com/issues/?jql=affectedVersion %3D "10.3 Rio" and status not in (Closed%2CDone%2CResolved) -
Yup, did that. To work around that issue, you can put list.List into the watches.
-
Delphi 10.3 TTimeSpan.GetScaledInterval Android
Stefan Glienke replied to mausmb's topic in Cross-platform
What exactly do you do, what you posted is a private method that obviously gets called from another public method. Please show your code. -
For..to..step in Delphi
Stefan Glienke replied to Primož GabrijelÄiÄ's topic in Tips / Blogs / Tutorials / Videos
@Arnaud Bouchez I know you like to deal with low level stuff but being able to be more declarative about loops and other language constructs is a benefit imo. That var passing of the loop variable is bad, but Primoz wrote that just for fun and advised not to use it. I guess every Delphi developer knows how a while or repeat loop works but I have seen enough off by one errors caused by counting the loop variable wrong, messing up the loop condition or other stuff which could just be eliminated if the language itself could treat it right without the need to put extra abstractions ontop that just make code slower. Another thing that just applies to 10.3 though is that only in a for loop you can inline declare the variable to only be valid in the loop scope and not outside. -
Custom Managed Records Coming in Delphi 10.3
Stefan Glienke replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Better than releasing something that is broken and makes all your code fail, amiright? -
New feature: TMARSClientResourceJSON now implements REST.Client.IRESTResponseJSON
Stefan Glienke replied to Andrea Magni's topic in MARS-Curiosity REST Library
The joys of packages as a library author. Looks like commit ace9e54 only modified the 10.2 package. That commit removed the following files: MARS.Client.Messaging.Resource.pas MARS.Client.SubResource.JSON.pas MARS.Client.SubResource.pas MARS.Client.SubResource.Stream.pas Just remove them from the contains in the MARSClient.Core.dpk and you should be able to compile. -
untilhttps://conf.spring4d.com/
-
Custom Managed Records Coming in Delphi 10.3
Stefan Glienke replied to Marco Cantu's topic in RTL and Delphi Object Pascal
The second parameter of the Assign operator actually has to be either var or const [ref]. -
New official Embarcadero forums online
Stefan Glienke replied to Lars Fosdal's topic in Community Management
Wow they are still (happened on the old forums as well) leaking email addresses in the usernames as they seem to be generated from the email used on the old community page ... -
Clean Code and Fast Code Slides at EKON 22
Stefan Glienke replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
I am sure using the type keyword after the equals sign was not part of the original pascal syntax and is only there to let the compiler produce a new typeinfo instead of it just being an alias that still points to the exact same type. -
Using configuration records and operators to reduce number of overloaded methods
Stefan Glienke replied to Primož GabrijelÄiÄ's topic in Tips / Blogs / Tutorials / Videos
Agreed, type redeclaration is really not very helpful in many situations. - you still have implicit type compatibility no matter what - but helpers stop working- 7 replies
-
- language
- configuration
-
(and 2 more)
Tagged with:
-
Using configuration records and operators to reduce number of overloaded methods
Stefan Glienke replied to Primož GabrijelÄiÄ's topic in Tips / Blogs / Tutorials / Videos
And after that you show why the "right" way is bad... An URL consists of different parts which combined give a string, yes but should be represented as the different parts, hence the record. Especially since there are cases where such a type cannot just be represented as string or number but consists of different data of different types. Yes there might be a string representation but it should not be passed as that through your API.- 7 replies
-
- language
- configuration
-
(and 2 more)
Tagged with:
-
New in 10.3: IDE UI Improvements in the Main Window
Stefan Glienke replied to Mohammed Nasman's topic in Delphi IDE and APIs
It will not get them more customers just because it's 64bit and runs out of memory later because all the instabilities and the compiler getting into a bad state because of compile errors or what not crashing the IDE will still be there as will the poor code tooling. Going the easy/cheap way every time is what puts Delphi and the IDE into the current situation of constantly having to react to external factors and tinker around edges. Sometimes I really have a hard time believing that or you just avoid certain features or have subconsciously developed a certain habit to do things differently. Or you just use it to prepare demos. -
Using configuration records and operators to reduce number of overloaded methods
Stefan Glienke replied to Primož GabrijelÄiÄ's topic in Tips / Blogs / Tutorials / Videos
The benefit of the TUrl type opposed to differently named overloads is also that you declare a domain type and make the API cleaner than just (string, string, string) regardless the naming of the parameters- 7 replies
-
- language
- configuration
-
(and 2 more)
Tagged with:
-
Aligned and atomic read/write
Stefan Glienke replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Well you have a different definition then than Intel in paragraph 8.1.1 it seems. So unaligned data can be as well part of a struct/record which fits into a cache line and thus is guaranteed to be atomic. -
Aligned and atomic read/write
Stefan Glienke replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
isAtomic := not IsCrossingCacheLine(unalignedData);