Jump to content

Stefan Glienke

Members
  • Content Count

    1370
  • Joined

  • Last visited

  • Days Won

    130

Everything posted by Stefan Glienke

  1. Stefan Glienke

    Bug: anonymous methods in procedure list

    Anonymous methods normally don't appear in the procedure list (which I don't mind - so even if you decide to list them in the future, please make that optional). However when you have a function/procedure does not have any arguments and you don't write () they appear in the list: procedure Main; var f: TFunc<Integer>; p: TProc; f2: TFunc<Integer,Integer>; p2: TProc<Integer>; begin f := function: Integer begin end; // appears as empty entry in procedure list f := function(): Integer begin end; // does not appear p := procedure begin end; // appears as "begin end" in procedure list p := procedure() begin end; // does not appear p2 := procedure(x: Integer) begin end; // does not appear f2 := function(x: Integer): Integer begin end; // does not appear end;
  2. Stefan Glienke

    Bug: anonymous methods in procedure list

    What does QP have to do with a GExperts bug?
  3. Stefan Glienke

    10.3.1 has been released

    Yes - all major versions can coexist
  4. Stefan Glienke

    How do you deal with git conflict annotations added to DFM files

    Well if you are working with ignoramuses you have to get the bigger guns out and install some commit hooks to prevent them from committing unresolved conflicts. Google will help you finding out how that works.
  5. Stefan Glienke

    How do you deal with git conflict annotations added to DFM files

    Slap your coworker because he obviously did not resolve a conflict and just commited this (this is git 101). This is how git annotates the code when there is a conflict and usually you then call git mergetool (or similar) or just use the resolve conflict button in whatever git ui client you are using. Remove lines 2, 4 and 6 and decide if you want to keep 3 or 5
  6. Stefan Glienke

    FastMM4 and False Positives

    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...
  7. Stefan Glienke

    RTTI usage and edge cases :) Can't use GetType on T

    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.
  8. Stefan Glienke

    Get memory usage information

    When you call that procedure while objects are allocated it will list them!
  9. Stefan Glienke

    Get memory usage information

    Make procedure FastMM4.CheckBlocksOnShutdown(ACheckForLeakedBlocks: Boolean); accessible in the interface section and simply call it.
  10. Measure again with optimization on and stackframe off (release config) - I guess the overhead for the getter/setter calls will shrink.
  11. 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)
  12. Stefan Glienke

    Jumping to methods via procedure list does not expand region

    @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.
  13. Stefan Glienke

    ITask.Wait() behaving differently when called multiple times

    No, because although technically not raise will free but the code running after any exception handling code unless you called AcquireExceptionObject.
  14. Stefan Glienke

    ITask.Wait() behaving differently when called multiple times

    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.
  15. Stefan Glienke

    Jumping to methods via procedure list does not expand region

    I thought, that is what I just did... - and no, I am not creating a sourceforge account just for that.
  16. Stefan Glienke

    The Android 64bit deadline warnings have started

    Learn how private equity firms work and you understand why things happen as they do.
  17. 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 😉
  18. Stefan Glienke

    Constructors + Destructors in class helpers?

    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.
  19. Stefan Glienke

    Using GetMethod functions in the .NET COM interop

    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)
  20. Stefan Glienke

    Linux Support on Pro Edition

    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.
  21. Stefan Glienke

    Using GetMethod functions in the .NET COM interop

    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.
  22. Stefan Glienke

    Using GetMethod functions in the .NET COM interop

    https://stackoverflow.com/a/1395915/587106
  23. Stefan Glienke

    Using GetMethod functions in the .NET COM interop

    Probably by calling Type.GetType(string)
  24. Stefan Glienke

    Marshmellow

    Delphi ecosystem in a nutshell. Sell things that are available as open source in other languages. Not judging - just observing.
  25. Stefan Glienke

    Constructors + Destructors in class helpers?

    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.
×