Jump to content

Stefan Glienke

Members
  • Content Count

    1518
  • Joined

  • Last visited

  • Days Won

    154

Everything posted by Stefan Glienke

  1. Stefan Glienke

    Byte and Integer

    Give some more votes to https://quality.embarcadero.com/browse/RSP-16751 maybe we get it some day...
  2. Stefan Glienke

    JEDI Installation Annoyances 10.4

    If the term pebcak is offending you must be new to the internet. I simply explained the way that always works for installing jcl/jvcl 1. The same as always - jcl\lib\d27\win32 or win64 and jcl\source\include 2. Yes, works JCL/JVCL setup issues are almost always a problem with not properly executing them or rather not having the latest jcl/jvcl sources or having some old stuff lying around. Maybe you did not update the submodule and are missing on the defines for 10.4 Also did you select both (10.4 32bit and 10.4 64bit)? And did not set the "Install selected only" checkbox?
  3. Stefan Glienke

    Is there a way to make DUnitX ignore exceptions?

    Clearly you need to write your own WillRaise version that does not just swallow the exception but passes it on to the logger.
  4. Stefan Glienke

    JEDI Installation Annoyances 10.4

    Clearly a pebcak. Just pulled the jcl repo, ran install.bat - it compiled the setup using 10.4 and then I installed JCL for 10.4 32bit and 64bit without a problem
  5. I answered your question on the Spring4D forum - sometimes I have weekend or vacation - thus no immediate answer 😉
  6. procedure Main; begin var Bob := TSmartPointer.Wrap(TTalking.Create('Bob')); Bob.Talk; Bob := TSmartPointer.Wrap(TTalking.Create('Another bob')); Bob.Talk; end; Leak because Wrap just blasts the newly created smartpointer into result not caring if its already assigned - interface results are passed as var parameter and thus contain the value that was in them before the call. I am tired fixing code that other people post on SO that I already implemented properly myself. 🙂
  7. Stefan Glienke

    Embarcadero entries in the path

    Matters if you have many different versions installed which can be typical for library or component developers - and every installation puts quite a bit into the path environment variable. Here is how mine looks (I have XE, 10.1, 10.2, 10.3 and 10.4 installed - and so far it's ok on Windows 10): I did not do the work yet on this Machine but on my older Win8.1 machine i had everything from Delphi 2010 to 10.3 installed and that completely blew the max length of the path variable so I substituted the common parts of the paths (such as programfiles or public documents)
  8. Ugh - just stop it please - first there is a typo resulting in an AV as TS in TSmartPointer.Wrap needs to be of type TInjectType<T> (fwiw these types are not necessary at all as you can just call New(p) and have the correct amount of memory allocated) and second this implementation will leak if you assign TSmartPointer.Wrap<T> to anything that is not nil already.
  9. No, actually pretty good, thank you. 🙂 It's just the experience with issues being reclassified and then "forgotten". And yes it can always be worse is also a way of optimism 😉
  10. Too bad it will most likely rot in JIRA with the other 1900 open as "new feature" classified issues...
  11. And some of it is unfortunately completely unnecessary and applies to every managed type! See https://quality.embarcadero.com/browse/RSP-27375
  12. hardly - its approx 25% to 50% slower because it has to create and destroy an entire object with all bells and whistles. 🙂
  13. Stefan Glienke

    You RAD Studio 10.4 Sydney appreciated features and bug fixes

    @pyscripter Looks weird given how other managed types lifetimes are being handled - but since we don't have precise language and design specs as always we can just guess. Apart from that implementing smartpointer that way is wrong anyway because they break whenever there is an explicit or implicit assignment/copy going on. Proper smartpointer need a shared block that holds a reference counter. Shared<T> in Spring is implemented with several optimizations to avoid the overhead of object creation for this purpose using the all known "interface in record" approach and I challenge everyone to come up with a robust implementation using custom managed records to beat that.
  14. Stefan Glienke

    language updates in 10.4?

    That is only an issue for library authors that need to target a range of past versions which is the vast minority of Delphi users. Most migrate to a new version, start using that and never have to run their code through previous versions. Type inference for inline variables is a really nice thing - no need to explicitly decare the type just to tell the compiler (yes, if you name your variable properly the type is irrelevant for understanding the code, ask programmers from other languages that have this feature for a long time). Also often enough you have to add units to a uses clause just to declare a variable of a type that is the return of a method of some other type being used - with type inference that becomes unnecessary.
  15. I don't understand the original problem - please describe exactly the data in a complete but small enough sample and the way you want it to be organized/shown.
  16. Stefan Glienke

    Fonts & ligatures

    As far as I know the editor control does not support ligatures
  17. Stefan Glienke

    FastMM5 now released by Pierre le Riche (small background story)

    FWIW I have done similar but in many cases just looking at the disassembly does not tell the entire story - running the code and profiling it (which can be a very tedious process given the many different uses cases etc) will often tell a different story and modern hardware architecture just shows you the middle finger. Especially for routines that get inlined in many different places although they might produce a little bit better disassembly it might not be worse or even better in some cases to not inline them if they can be written jump free because the code will be smaller and likeliness of staying in the instruction cache will be higher. But again we are talking about microoptimization here that requires a lot of profiling and looking at some cpu metrics.
  18. Stefan Glienke

    FastMM5 now released by Pierre le Riche (small background story)

    I don't know about the particular piece of code but I absolutely second that - if you can avoid branching, please please do so - unfortunately neat and clean code (an innocent looking if or a loop) can easily turn into a performance drain.
  19. Some of the benchmark results are just eyewash fwiw
  20. Stefan Glienke

    RTTI info for TBytes using runtime packages

    Regardless the current typeinfo issue I would always check for typeKind = tkDynArray (and possibly even tkArray) and ElemType = Byte because then you can also handle any custom declared TMyBytes = array of Byte type.
  21. Stefan Glienke

    RTTI info for TBytes using runtime packages

    The types are assignment compatible. When you declare a variable of TBytes in one module and call a method from a runtime package that uses TBytes that code will compile and work. Just the typeinfo generated is different so if you do some RTTI work you get false results.
  22. Stefan Glienke

    RTTI info for TBytes using runtime packages

    The issue is that TBytes is an alias for TArray<Byte> - generic types being used across different modules have several implications such as that they manifest into each module with their own typeinfo being generated. Try this code for example: uses Rtti, SysUtils; var ctx: TRttiContext; begin Writeln(ctx.GetType(TypeInfo(TBytes)).QualifiedName); end. In a regular console application it will print: System.TArray<System.Byte> While you would assume that it should print: System.SysUtils.TBytes Now if you enable runtime packages for this console application and let it link with rtl you will get an ENonPublicType here. Every module that is using TBytes is not referencing some type that is declared in the RTL runtime package but emiting its own version of TArray<Byte> into its binary. Personally I think this is an issue with the compiler treating the declaration of TBytes = TArray<Byte> different from TBytes = array of Byte in terms of the typeinfo generated - I was sure there is a QP entry somewhere about it but I cannot find it right now. To further provide the proof that aforementioned assumptions of other posters are wrong use the following code with a console application linking with the rtl package: uses Rtti, TypInfo, Classes, SysUtils; var ctx: TRttiContext; begin Writeln(ctx.GetType(TBytesStream).GetField('FBytes').FieldType.Handle = TypeInfo(TBytes)); end. This will print FALSE as the typeinfo of the FBytes field which is of type System.SysUtils.TBytes in fact differs from the typeinfo generated for the usage of TBytes in the console application binary. In fact there does not even exist a type called TBytes but only System.TArray<System.Byte> as TBytes it just an alias as I said and the declaration TBytes = type TArray<Byte> is not legit and raises E2574 Instantiated type can not be used for TYPE'd type declaration
  23. Stefan Glienke

    Difference between Pred and -1

    Fun fact: you can omit the 3rd argument of Copy if you just want to cut from the beginning.
  24. Stefan Glienke

    Find record operators via Rtti?

    https://bitbucket.org/sglienke/spring4d/src/409cf53e4848815ac089763243469226b363d3be/Source/Base/Spring.pas#lines-3806
  25. Stefan Glienke

    Exception.CreateFmt vs. CreateResFmt

    It gets bad if the implicit string or other managed type variables are the only of that type because then you get the implicit try finally added. And at least for win32 we know now that try/finally is implemented kinda badly: https://quality.embarcadero.com/browse/RSP-27375
×