-
Content Count
3668 -
Joined
-
Last visited
-
Days Won
181
Everything posted by David Heffernan
-
Is Class with 2 'nested' constructors bad design?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
That's a false goal. Remove that goal from your life. Following it will be making your code worse. -
Is Class with 2 'nested' constructors bad design?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
It works. But better to have one constructor that accepts an argument. Think of the time you need to decide at runtime which path to take. Then your way is hopeless. -
How should I organize cross platform code?
David Heffernan replied to Mike Torrettinni's topic in Cross-platform
Ugh, the code you write shouldn't need those ifdefs. That the entire point of you using the libraries provided by others, like Emba. They present a common interface to you. That's the entire point of cross platform coding. -
language updates in 10.4?
David Heffernan replied to David Schwartz's topic in RTL and Delphi Object Pascal
Spend some time looking at the development process and quality over in C# and .net land, and then see if you honestly can regard Emba's process and quality even remotely in the same ball park. -
It's not a choice between either generics, or polymorphism. You can use both.
-
Because that's the only way to make this work. Your expectations seem unrealistic. As I see it you face two choices: 1. Code it the way I said, and thus have your code work the way you want. 2. Code it your way, and have your code not work the way you want. I don't understand why you want to take option 2.
-
constructor constraint isn't going to be much use here, you can get rid of it. What you need is a virtual constructor on the base class, and virtual methods. And then obviously to override those methods on subclasses.
-
What is the best way LoadFromFile & Thread? (FMX)
David Heffernan replied to pieomy00's topic in FMX
We don't really know what your main goal is. Hard to give useful advice. -
What is the best way LoadFromFile & Thread? (FMX)
David Heffernan replied to pieomy00's topic in FMX
Define "best" please. Also, the try/finally seems a little pointless. -
Generics and Classes on Windows 2000 = OOM
David Heffernan replied to aehimself's topic in General Help
no -
language updates in 10.4?
David Heffernan replied to David Schwartz's topic in RTL and Delphi Object Pascal
The eternal optimist -
Generics and Classes on Windows 2000 = OOM
David Heffernan replied to aehimself's topic in General Help
Strange suggestions given that all symptoms point to memory leak in your code. -
Generics and Classes on Windows 2000 = OOM
David Heffernan replied to aehimself's topic in General Help
Smells like a memory leak, or perhaps the loss of contiguous address space due to fragmentation from reallocation. -
Generics and Classes on Windows 2000 = OOM
David Heffernan replied to aehimself's topic in General Help
It's very plausible that you have a memory leak. Just because fastmm4 says you don't doesn't mean you don't. It's one thing returning memory when the program closes, another returning it in a timely fashion during execution. -
Generics and Classes on Windows 2000 = OOM
David Heffernan replied to aehimself's topic in General Help
Didn't you read that topic? The entire topic was based on misconception. -
No. It's a suggestion that if you want an improvement to an open source project then one option is that you contribute it yourself. ALL-CAPSing the project maintainer is a strategy that in my opinion is sub optimal for your goals.
-
Why don't you have a go at fixing it, and contributing the fix?
-
Image pointer and buffer size
David Heffernan replied to dkprojektai's topic in Algorithms, Data Structures and Class Design
Perhaps you know what this is. We don't. Try to imagine that we can't see your screen. -
tDictionary<>.SetCapacity
David Heffernan replied to Vandrovnik's topic in RTL and Delphi Object Pascal
Isn't this something you set when you create the dictionary? Does the spring4d implementation offer more functionality? -
Image pointer and buffer size
David Heffernan replied to dkprojektai's topic in Algorithms, Data Structures and Class Design
What is your actual problem for which you need a solution? Because what you are asking doesn't actually make sense. -
Why TList uses a lot more memory than TArray?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Flip side, you can have loads of available memory but no available contiguous address space. That's the advantage of a 64 bit process. It removes the limitations on address space. -
Why TList uses a lot more memory than TArray?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I have no qualms about working with a 2G memory block under 64 bit. What exactly are you getting at? Can you explain in technical terms what problem you envisage? -
Why TList uses a lot more memory than TArray?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Two names for the same thing in my eyes. But if the official title is page file then that's what we should say, I agree. -
Why TList uses a lot more memory than TArray?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Then you'll fragment your address space and perhaps worse spend time doing expensive heap allocation. I don't know why you think SetLength(arr, Length(arr) + 1); arr[High(arr)] := item; is preferable to list.Add(item); And what about if you hold classes in a list, how do you manage lifetime? Lots of good reasons to use a good library of collection classes. -
Why TList uses a lot more memory than TArray?
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
So when you populate an array, and its full but you need to add more items, how do you grow it?