-
Content Count
1498 -
Joined
-
Last visited
-
Days Won
152
Posts posted by Stefan Glienke
-
-
Wrong: TypeInfo(SchemaTemplate)
Right: TypeInfo(T);Also fwiw making the entire method generic although you only need the typeinfo of T supports code bloat - it would be better to make it non generic and a small generic overload that just passes down the typeinfo to the non generic one.
-
When you call that procedure while objects are allocated it will list them!
-
Make procedure FastMM4.CheckBlocksOnShutdown(ACheckForLeakedBlocks: Boolean); accessible in the interface section and simply call it.
-
Measure again with optimization on and stackframe off (release config) - I guess the overhead for the getter/setter calls will shrink.
-
@Larry Hengen How many open source projects do you maintain? So speak for yourself - I have received enough issue reports over the years not via bitbucket but on forums, via email or someone told me personally that I then either entered myself or just fixed (yes I need to make a habit of first reporting and then fixing so its documented outside of just a commit that says fixed xyz). It does not matter where but how and what. A poor report with zero info on bitbucket is as time consuming as a bad one elsewhere.
-
3
-
-
56 minutes ago, Der schöne Günther said:Does that mean 10.3 raises an exception for both times?
No, because
1 minute ago, Schokohase said:The exception is stored in the Task object and once it is raised it will be removed and it can not be raised again because of lifetime mangement (raise will free the exception)
although technically not raise will free but the code running after any exception handling code unless you called AcquireExceptionObject.
-
In 10.3 it actually raises an EAggregateException with the EProgrammerNotFound as inner exception.
I guess because the exception mechanism in Delphi destroys handled exceptions they cannot be raised that easily a second time as .NET does
@Dmitry Arefiev Documentation should be expanded a little though.
-
1 hour ago, dummzeuch said:Please file a bug report.
I thought, that is what I just did... - and no, I am not creating a sourceforge account just for that.
-
When the method/routine being jumped to via procedure list is inside a collapsed region this region is not being expanded causing weird behavior.
Same is the case for using "Previous/Next Identifier Reference" (Ctrl+Alt+Up/Down)
-
2
-
-
Learn how private equity firms work and you understand why things happen as they do.
-
3
-
-
https://refactoring.guru/replace-constructor-with-factory-method
However I would go a step further and use delegates where you stick that implementation into.
Example:
You have Cat and Dog class that both derive from Animal - now because Func<T> is covariant you can write this:
Func<Animal> makeAnimal = () => new Dog();
Or you can make some function that creates these Func<T> for you - then you can write:
var makeCat = MakeFactory<Cat>(); // this is basically like the place in Delphi code where you would assign the TCat class to a TAnimalClass variable makeAnimal = makeCat; // again - covariant - a function returning a cat can be assigned to a func returning an animal var cat = makeAnimal(); // cat will be of type Animal though because that is the return type of makeAnimal - but that is the same for Delphi meta classes
Or just use DI 😉
-
1
-
-
4 hours ago, Lars Fosdal said:lack of inheritance
Inheritance of helpers is not solving the problem at all - you then still can have the case where you would want to use methods from 2 different helpers which cannot inherit from each other.
The only solution is to make not only the last visible helper usable but treat conflicting methods via overload resolution - just like extension methods in C# do.
-
2
-
-
4 minutes ago, Dave Nottage said:Can you clarify what this means?
You want to get some method via reflection - thats why you asking for calling GetMethod_5. Now that one requires you to pass the signature via an array of types.
What are you going to do with that? Obviously you want to then invoke that method, no?
But in order to do that you then need to pass the parameter values for that particular overload - what are those? You need to have some - ask them for their type (GetType)
-
This example shows how bad it is that the Delphi compiler does not actually warn about assignment of differently sized ordinal types but instead silently truncates them. (FPC has a flag for that).
If it did chances are very high you would have found it immediately.
-
1 hour ago, David Heffernan said:I expect that there is a way to obtain Type and call methods on
And that is what I don't think because it is said in that answer that you cannot call static methods via COM - but I agree that putting all that code into the C#/.NET side and just call it might be easier.
Edit: You obviously want to call the method that you are trying to get and pass the parameters to it that you need the types for - so ask those instances that you are planning to pass to the method for their type.
-
-
-
On 5/2/2019 at 12:48 PM, Holger Flick said:I would rather have a lot of things, but that's simply not how you can put food on the table.
Delphi ecosystem in a nutshell. Sell things that are available as open source in other languages. Not judging - just observing.
-
1
-
-
Took me 10 seconds to try it out. Ctor can be added, dtor not (E2295).
Which makes sense if you think about it. Adding a different way to create new instances depending on if the helper is there or not is not a problem.
But not how existing instances are being destroyed.
-
I guess you are a bit naive in your assumption of what it takes to get from something like VSCode to a fully featured IDE like RAD Studio or Visual Studio...
Because otherwise why is there still that thing called Visual Studio that MS is putting significant resources into it if they could slap a few extensions onto VSCode?
-
5
-
-
One of the reasons I never really got into MMX despite everyone telling me that it is a must have was its overloaded UI with all the toolbars and stuff after you installed it.
Yes, you can turn off most of it but it would really pleasant if there was a simple option to switch between something like a "light" and "full" version easily (or even more different presets) - possiibly selectable during setup.
-
4
-
-
Recently I'm in desperate need of the facepalm reaction...
-
2
-
-
And these topics even keep popping up in terms of marking them bold on the overview when only comments by ignored people were written - very annoying.
While G+ was certainly not perfect the way notifications worked was fine except the impossibility to get notified on topics without leaving some dummy comment.
-
No, I want an opt-in, not an opt-out.
FastMM4 and False Positives
in General Help
Posted · Edited by Stefan Glienke
There are no false positives to this - if FastMM reports this it's true. These errors are usually very subtle and the reference to that freed instance might only live a few cycles more and unless there does not happen another memory allocation that might reuse this particular piece of memory there will never be a defect (in terms of an AV happening or something) which is why this usually goes unnoticed by most until you enable this option which is not part of the build-in FastMM version (which is a shame!).
It's unbelievable how ignorant some vendors can be...