-
Content Count
3660 -
Joined
-
Last visited
-
Days Won
181
Everything posted by David Heffernan
-
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
The real trick there is not to do it. Avoid it at all costs. -
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
I don't really understand this. I always write the try/finally immediately after the construction, and always bang the Free in immediately. Then I fill out the body. It's just a habit that you form so that you don't make such mistakes. And honestly, this is never one that is hard to debug because you just have a leak. And presumably you use leak detection tools so that you'd always find them immediately. I don't really understand this scenario either. If you have a reference to something that may or may not exist, you would test Assigned() before using it. And when you were finished, you'd set the reference back to nil once you'd destroyed it. The scenario that is tricky is when you have multiple references to an object. -
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
Keep searching then -
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
It's odd you say that, but I never have to debug issues like this. There are two simple patterns for lifetime and they are so ingrained, nobody ever makes a mistake in my team. -
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
(PDF) Application of artificial intelligence in compiler design (researchgate.net) (ijresm.com) -
Delphi and "Use only memory safe languages"
David Heffernan replied to Die Holländer's topic in General Help
Yeah, you are wrong. Such people exist. I am one. Not necessarily. No reason why pointer arithmetic should be faster than, for example, plain indexing of arrays. Again, good compilers are often better than humans. I don't think pointers are used in the RTL especially more than other libraries, and I don't think pointers are used there fore for optimisation and performance. As far as this whole memory safety debate goes, you can't exclude the RTL from it. That code executes in the code that is subject to attack. -
I'm not quite sure what you are saying here? Are you looking to hire somebody?
-
What is the target Win 64 (Modern) in Delphi 12.1
David Heffernan replied to pyscripter's topic in Delphi IDE and APIs
This was in fact mentioned -
I guess they will be able to say that the numbers of bugs reported is going down and claim that indicates quality has improved.
-
Split views which other IDEs have had for years. And bug fixes. But still no way to report bugs. Does this seem like value for money to anybody?
-
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
Unlucky for you. I've so far never encountered such a problem. The type of thing that forces me to debug 64 bit is when it's my DLL hosted in a 64 bit process, and I don't have a 32 bit version of the host. -
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
I think all in all, it's clear that the current in-process design is the right one -
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
How are you going to have the components paint themselves on the design surface? -
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
Win64 debugger is known to be terrible. Perhaps slightly less so with more recent versions. I always debug 32 bit if at all possible. But sometimes you have a scenario where that's not possible. Unlucky if you do. -
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
I can imagine this working fine for non visual components but what about components that paint themselves on the design surface? Cross process window hierarchies are basically untenable. -
IntToStr algorithm (Interesting read)
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Automatic stack allocation is faster than all heap allocators, and has no thread contention. And Delphi's current heap allocator is known not to be scalable. I've measured this in a real world setting. Avoiding heap allocations when converting numbers (integer and real) to text makes a huge performance difference when creating files, e.g. XML, JSON, YAML. Even when single threaded. When multi-threading the impact is even greater, if using the default heap allocator. I personally use isolated per thread heaps to reduce contention. This doesn't eliminate it because every allocation/deallocation that requires a call to VirtualAlloc and friends has contention. -
Do you need an ARM64 compiler for Windows?
David Heffernan replied to Lars Fosdal's topic in Cross-platform
I mean, how hard could it be???? -
TStringStream inconsistent results
David Heffernan replied to Mark Williams's topic in RTL and Delphi Object Pascal
You suspect encoding is an issue but I can't see in your post any discussion of encoding. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
Sometimes you do compare up to tolerance. Sometimes that's the right way to do it. But you need to know how to choose the tolerance. And it's definitely wrong to say that one must never compare exactly. Sometimes you can. Although delphi rtl works against you. For instance you'd hope to be able to convert floats to text, and back, and get the same value. In Delphi using the rtl functions this isn't always the case. Embarcadero have known this for more than a decade and not done anything yet. I just don't think they have the resources required to prioritise this given all their other commitments. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
It depends on what you are comparing, what algorithms are involved etc. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
Well, that's true. Lots of thread safety issues with how it handles floating point control status. But that's not that same as having a math lib. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
I don't have a math lib that is publishable. I've never wanted to have or do such a thing. You must be mis-remembering. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
I know how floating point math works, it's been what I've done for a living for the past 30 years. Using arbitrary epsilon values is not failsafe and relies on luck. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
Floats can be compared for exact equality, in plenty of circumstances. The beginner mistake is to use some epsilon value without any sound rationale for it. Usually, and works pretty good, and for the majority of cases doesn't sound great with my numerical programming head on. -
Regression - Delphi 12 - IsZero()
David Heffernan replied to ŁukaszDe's topic in Delphi IDE and APIs
This entire approach of applying some arbitrary epsilon is rubbish. I can't imagine any scenarios where they'd be useful and I've only ever seen them used inappropriately.