Jump to content

Stefan Glienke

  • Content Count

  • Joined

  • Last visited

  • Days Won


Stefan Glienke last won the day on September 12

Stefan Glienke had the most liked content!

Community Reputation

1723 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Stefan Glienke

    When will we have a 64-bit IDE version ?

    Could it be that you have some active database connection and live data? That contributes to the memory consumption of the bds.exe process.
  2. Stefan Glienke

    String literals more then 255 chars

    A multiline string is multiline - simple as that.
  3. Stefan Glienke

    String literals more then 255 chars

    The closing quotes dictate the alignment, lines inside the string thus cannot be more left than the closing quotes, the last line does not have a trailing line break, if you want a trailing line break, add an empty line
  4. Stefan Glienke

    Double checked locking

    Why exactly? data is the PByte parameter that comes into that function and if ultimately not nil it gets passed to ConstructAttributes
  5. Stefan Glienke

    Playing with Windows Fibers by emulating Python Generators

    People like Gor would call the majority of the Delphi RTL and alike "not an appropriate solution for writing scalable concurrent software" so we have to be a bit reasonable when putting this statement into context.
  6. Stefan Glienke

    Windows ARM support ?

    Given that PowerToys is on GitHub, I would say that "they" is the community and not only MS - see "Support ARM platform"
  7. Stefan Glienke

    Call for Delphi 12 Support in OpenSource projects.

    As one of the few lib devs that actually test their code on all supported Delphi versions I object - dproj files so often have incompatibilities in them. Yes, it is possible to have only multiple dproj files but only one dpk they refer to and put the libsuffix stuff into an inc file referencing that one on the dpr (have done that, works fine) but it is tedious. I rather copy the latest version when a new one comes out/is in beta. The more important thing imo is using forward-compatible defines in the code - it drives me mad whenever I compile some code in a newer version and it simply does not work because the code requires explicit defines because they are not done in a forward-compatible way.
  8. Stefan Glienke

    Are local TGUIDS preinitialized?

    If you are referring to TGUID specifically then I would assume that to be the case as that is basically what happens because it has operator overloading. To be more precise though because my previous comment might be misleading: - currently, we don't get any W1036 on using a field on some local record variable (see Test4) - we get a W1036 on local intrinsic non-managed type variables such as Integer (see Test1) - we *don't* get a W1036 on local intrinsic non-managed type variables such as Integer when they get passed by ref (see Test2) or a helper method is being called on them (see Test3) anywhere in the routine. type TIntHelper = record helper for Integer procedure Foo; end; procedure TIntHelper.Foo; begin end; procedure PassRef(var ref); begin end; procedure Test1; var i: Integer; begin if i = 0 then Writeln; end; procedure Test2; var i: Integer; begin if i = 0 then Writeln; PassRef(i); end; procedure Test3; var i: Integer; begin if i = 0 then Writeln; i.Foo; end; procedure Test4; var g: TGUID; begin if g.D1 = 0 then Writeln; end; end. My point is - yes I can craft some version of Test4 where something might happen with g that causes it to be initialized or not - but the point is: if I access any field on it *before* that it is a hundred percent certain that I am accessing an uninitialized field. Now in practice the compiler source code and its design might be in a state where doing this is hard to achieve but the point is: it's not impossible.
  9. Stefan Glienke

    Are local TGUIDS preinitialized?

    We already have the situation that calling any method on a record disables the warning - I did not mention disabling that behavior, did I? Also, don't you think a compiler could easily see if the access to a field happens before or after some method call? I explicitly stated that there would still be cases where a W1036 would be appropriate but would not be seen due to some reasons but in the places where it is hundred percent certain that the access is to an uninitialized field the compiler should raise it
  10. Stefan Glienke

    Are local TGUIDS preinitialized?

    The explanation was given by the pm and not some compiler dev fwiw and it is nonsense tbh. The compiler already knows if a record is managed or not because if its managed then it inserts code to call to System._InitializeRecord. Now the case can happen that you access some field on a record that is a managed record but that field is of a non managed type - these fields are not touched inside that routine. The compiler can still issue a W1036 when accessing a field on a record that is not managed - would there still be cases where a warning would be missing? Yes, but it would be better than it is currently.
  11. Stefan Glienke

    Playing with Windows Fibers by emulating Python Generators

    Coroutines are not a dead end at all - in fact, there are more and more languages making them first-class citizens because you can write asynchronous code just like you would write sequentially. Google for "project loom" for example.
  12. Stefan Glienke

    Playing with Windows Fibers by emulating Python Generators

    https://bitbucket.org/sglienke/spring4d/branch/feature/coroutines - the reasons it never made it into the main branch are what has been mentioned before and the fact that on POSIX I emulate them using a thread and an event (which is deadly slow) - still until anyone convinces me otherwise (by showing some actual working code!) this is the closest we get to some conveniently usable coroutines in Delphi.
  13. How would changing the variable from ColorRef to TColor help? That will only change the location of the warning because RGB returns ColorRef (given this is the function from Winapi.Windows.pas).
  14. Stefan Glienke

    String comparison in HashTable

    I am not sure what y'all discussing here but the snippet that Tommi posted is about checking the first character before even calling strncmp (video at around 15:15). It's pretty obvious why that is faster - if the characters don't match you get rid of the function call. The algo does not need to restrict anything - the hashtable contains all keywords and the input is any string that occurs in the source code - if it's a keyword, it gets found, if it's not, then it won't be found, simple as that.
  15. Stefan Glienke

    Rounding issue

    On 32bit the compiler keeps the value of the multiplication in the FPU to pass it to Round (which takes its parameter as Extended), on 64bit the precision of Extended is the same as Double. You get the same result on 32bit if you store the result of the multiplication into a double variable and then pass that one to round.