-
Content Count
3624 -
Joined
-
Last visited
-
Days Won
179
Everything posted by David Heffernan
-
Custom Managed Records Coming in Delphi 10.3
David Heffernan replied to Marco Cantu's topic in RTL and Delphi Object Pascal
In C++ you can prevent it from happening. -
Custom Managed Records Coming in Delphi 10.3
David Heffernan replied to Marco Cantu's topic in RTL and Delphi Object Pascal
This is still an enormous weakness in the language. -
Clean Code and Fast Code Slides at EKON 22
David Heffernan replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
It's fairly clear that the Delphi language we are referring to was designed to make such types assignment compatible. That is made clear by the documentation for the Delphi language. There are other languages that have taken different approaches, but we aren't discussing those languages here. We are discussing Delphi. Whilst you might wish that a different decision had been taken, it wasn't. It's really not likely to change. -
Clean Code and Fast Code Slides at EKON 22
David Heffernan replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
But the language was designed differently. Use records. What's so difficult about that? -
Clean Code and Fast Code Slides at EKON 22
David Heffernan replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
Since the language regards these two types as assignment compatible, it's pretty hard to imagine adding warnings or hints when you write such assignments. Wrap the value in distinct record types. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Fair enough. -
Clean Code and Fast Code Slides at EKON 22
David Heffernan replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
You'll need to declare two record types for this. The language isn't going to change now. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
@Stefan Glienke And the existence of two byte data that cross cache lines shows that unaligned access is not atomic. When arguing about non deterministic properties like atomic access or thread safety the language used is a little different. When we say code is. It threadsafe we don't mean that it will always fail. We mean that we can't guarantee that it will always succeed. When we say memory reads are not atomic we don't mean that they won't always be read with multiple bus reads. We mean that we can't guarantee that they will always be read with a single bus read. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
You agree then that unaligned access of data greater than a single byte is not atomic? -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
That's what you said. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Yes, I read what you wrote. What you wrote was wrong. You said nothing about cache lines. -
Custom Managed Records Coming in Delphi 10.3
David Heffernan replied to Marco Cantu's topic in RTL and Delphi Object Pascal
There's nothing to switch off. You choose to switch it on on a type by type basis. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Single bytes are aligned, because they can't straddle cache lines. Reads are therefore atomic, because they are aligned. Two byte reads can straddle cache lines and unaligned reads are not atomic. -
Aligned and atomic read/write
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Actually both of these statements are wrong. Reading unaligned memory is not atomic for reads that straddle cache lines. And unaligned memory access is not slow on modern processors. -
Managing Version Information Across Builds
David Heffernan replied to Nathan Wild's topic in Delphi IDE and APIs
The IDE's tools aren't well designed in my view. Don't set the version information that way, instead make it part of your automated build process. -
Warning W1010: Method hides virtual method of base type
David Heffernan replied to Kryvich's topic in RTL and Delphi Object Pascal
It's not that the override does nothing. There is no override. It makes no sense to me to reintroduce a method of that name. -
Warning W1010: Method hides virtual method of base type
David Heffernan replied to Kryvich's topic in RTL and Delphi Object Pascal
Why don't you override the method from TObject?