-
Content Count
3536 -
Joined
-
Last visited
-
Days Won
175
Posts posted by David Heffernan
-
-
1 hour ago, Georgge Bakh said:David, if I got you right, your advice is to use the technique with virtual methods because it works. It's a good advice thank you.
But I wanted to use generics as it's a powerful technique which I successfully use in other languages and it seems it should work for my case. And a broad range of other cases which can be identified as parametrization by code.
If it can't be done in Delphi it's sad but I'd want to know why. Is it a bug?
Let's get on with it:
I have TTest<TTest2> specialization of the above generic class TTest. May I expect that field FTest will have static type TTest2? If no why?
It's not a choice between either generics, or polymorphism. You can use both.
-
7 minutes ago, Georgge Bakh said:Why?
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.
-
We don't really know what your main goal is. Hard to give useful advice.
-
Define "best" please.
Also, the try/finally seems a little pointless.
-
49 minutes ago, aehimself said:Could this "leak"?
no
-
46 minutes ago, Sherlock said:I'm looking forward to a ton of bug fixes and performance improvements, for the IDE, the compiler(s) and the resulting executables.
The eternal optimist
-
2
-
1
-
-
Strange suggestions given that all symptoms point to memory leak in your code.
-
1
-
-
Smells like a memory leak, or perhaps the loss of contiguous address space due to fragmentation from reallocation.
-
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.
-
1
-
-
Didn't you read that topic? The entire topic was based on misconception.
-
23 minutes ago, PeterPanettone said:Is that a MORAL or RELIGIOUS assessment?
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.
-
2
-
-
9 hours ago, PeterPanettone said:Please fix that STONE-AGE BUG of not supporting paths that include a space character.
Why don't you have a go at fixing it, and contributing the fix?
-
Perhaps you know what this is.
2 hours ago, dkprojektai said:function ReadFromMemFile(hEngine: TENGINE; pBuffer: Pointer; bufferSize: Integer😞 TRESULT;
We don't.
Try to imagine that we can't see your screen.
-
1
-
-
Isn't this something you set when you create the dictionary? Does the spring4d implementation offer more functionality?
-
1
-
-
What is your actual problem for which you need a solution? Because what you are asking doesn't actually make sense.
-
1
-
-
22 minutes ago, Fr0sT.Brutal said:So doesn't matter whether the system is x64 or x128, available memory is limited.
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.
-
2 minutes ago, Fr0sT.Brutal said:Just a pretty large size for example. This could be 500M or 2G, doesn't matter.
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?
-
-
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.
-
So when you populate an array, and its full but you need to add more items, how do you grow it?
-
How could lists possibly consume less than an array?!!!
Let me ask you a question, do you have any code that does SetLength(arr, Length(arr) + 1)?
-
No. Wrong conclusion. That memory will be backed by the swap file. User may not have one. And even if they do perf is terrible.
Seriously, you are way down the rabbit hole. Give up thinking about the advanced stuff and concentrate on the basics. Make sure you know how lists work.
-
Yes, it would definitely help you to learn the difference between virtual and physical memory.
language updates in 10.4?
in RTL and Delphi Object Pascal
Posted
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.