Jump to content

Leif Uneus

Members
  • Content Count

    34
  • Joined

  • Last visited

Everything posted by Leif Uneus

  1. Is it not enough to declare DefaultCW8087 et al. as threadvar?
  2. Newly released FastMM5: https://github.com/pleriche/FastMM5 FastMM is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files. Version 5 is a complete rewrite of FastMM. It is designed from the ground up to simultaneously keep the strengths and address the shortcomings of version 4.992: Multithreaded scaling across multiple CPU cores is massively improved, without memory usage blowout. It can be configured to scale close to linearly for any number of CPU cores. In the Fastcode memory manager benchmark tool FastMM 5 scores 15% higher than FastMM 4.992 on the single threaded benchmarks, and 30% higher on the multithreaded benchmarks. (I7-8700K CPU, EnableMMX and AssumeMultithreaded options enabled.) It is fully configurable runtime. There is no need to change conditional defines and recompile to change options. (It is however backward compatible with many of the version 4 conditional defines.) Debug mode uses the same debug support library as version 4 (FastMM_FullDebugMode.dll) by default, but custom stack trace routines are also supported. Call FastMM_EnterDebugMode to switch to debug mode ("FullDebugMode") and call FastMM_ExitDebugMode to return to performance mode. Calls may be nested, in which case debug mode will be exited after the last FastMM_ExitDebugMode call. Supports 8, 16, 32 or 64 byte alignment of all blocks. Call FastMM_EnterMinimumAddressAlignment to request a minimum block alignment, and FastMM_ExitMinimumAddressAlignment to rescind a prior request. Calls may be nested, in which case the coarsest alignment request will be in effect. All event notifications (errors, memory leak messages, etc.) may be routed to the debugger (via OutputDebugString), a log file, the screen or any combination of the three. Messages are built using templates containing mail-merge tokens. Templates may be changed runtime to facilitate different layouts and/or translation into any language. Templates fully support Unicode, and the log file may be configured to be written in UTF-8 or UTF-16 format, with or without a BOM. It may be configured runtime to favour speed, memory usage efficiency or a blend of the two via the FastMM_SetOptimizationStrategy call. Experience/opinions welcome ...
  3. Leif Uneus

    RTTI in dpr / console app dpr

    Like using the $STRONGLINKTYPES directive? http://docwiki.embarcadero.com/RADStudio/en/Strong_link_types_(Delphi)
  4. Leif Uneus

    RTTI in dpr / console app dpr

    If a class is not used, RTTI information is stripped off by the compiler, See https://stackoverflow.com/q/10613094/576719
  5. Leif Uneus

    Typed constants in Delphi.

    Whether a typed constant is immutable or not is controlled by a compiler switch. See http://docwiki.embarcadero.com/RADStudio/en/Writeable_typed_constants_(Delphi)
  6. Leif Uneus

    Strange behavior for literals

    The type is still extended, but the value will be as a single(0.1) program Project169; {$APPTYPE CONSOLE} uses System.SysUtils, System.TypInfo; type TTypeInfo = class class function ShowTypeInfo<T>(const X: T) : String; end; class function TTypeInfo.ShowTypeInfo<T>(const X: T) : String; var LTypeInfo: PTypeInfo; begin LTypeInfo := TypeInfo(T); Result := LTypeInfo.Name; end; const F1 : Single = 0.1; F2 = Single(0.1); // <- Extended type, with the value of a single 0.1 F3 = Extended(0.1); begin WriteLn(TTypeInfo.ShowTypeInfo(F1):10,':',F1); WriteLn(TTypeInfo.ShowTypeInfo(F2):10,':',F2); WriteLn(TTypeInfo.ShowTypeInfo(F3):10,':',F3); ReadLn; end. Outputs: Single: 1.00000001490116E-0001 Extended: 1.00000001490116E-0001 Extended: 1.00000000000000E-0001
  7. Leif Uneus

    Strange behavior for literals

    @Vandrovnik, Still both F1 and F2 are of type extended.
  8. Leif Uneus

    TStopwatch.Elapsed

    Use StopWatch := TStopWatch.Create to initialize a new TStopWatch value in a stopped condition or StopWatch := TStopWatch.StartNew to return a started stopwatch. See http://docwiki.embarcadero.com/Libraries/Rio/en/System.Diagnostics.TStopwatch.Create
  9. You might be better off with this link to QP: https://quality.embarcadero.com
  10. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    Sorry @DavidHeffernan, but in the file posted by @pyscript his proposed function InterlockedCompareExchange128 returns a boolean.
  11. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    @pyscripter Note that in InterlockedCompareExchange128, the last line (MOVZX EAX,AL) is redundant. The function returns a boolean, one byte in size. And, in InterlockedCompareExchange, should it not be following code for the 32 bit ? Result := InterlockedCompareExchange64(Int64(Dest), Int64(NewValue), Int64(CurrentValue)) = Int64(CurrentValue);
  12. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    Maybe someone can understand this Q&A at SO: CMPXCHG16B correct? https://stackoverflow.com/q/4825400/576719 Or ask a new question at SO.
  13. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    It is linked by @pyscripter a few replies above.
  14. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    A little reference article to the CAS and ABA problem. http://ithare.com/cas-reactor-for-non-blocking-multithreaded-primitives/
  15. Leif Uneus

    language updates in 10.4?

    The greatest problem with inline variable declarations, are backward compatibility. I don't see any benefit, except for some logical clarifications.
  16. Leif Uneus

    Experience/opinions on FastMM5

    I still don't know why Embarcadero does not implement the FastCode purepascal Pos for win64. https://quality.embarcadero.com/browse/RSP-13687 In the example given, the fastcode win64 version is 8 times faster than System.Pos.
  17. From the introduction: It is fully configurable runtime. There is no need to change conditional defines and recompile to change options. (It is however backward compatible with many of the version 4 conditional defines.) It may be configured runtime to favour speed, memory usage efficiency or a blend of the two via the FastMM_SetOptimizationStrategy call.
  18. Leif Uneus

    Overstatic methods

    Closed as harmless.
  19. Leif Uneus

    modbus

    Look here for an overview of tools and software sources: http://www.modbus.org/tech.php For a Delphi Modbus TCP implementation (free), see: https://github.com/coassoftwaresystems/delphi-modbus
  20. See this answer from Embarcadero to a customer who wants to increase the registration count: Reinstalling Windows without re-registering Delphi Update : The linked message was deleted by a moderator. Only visitors with enough reputation can view the original message.
  21. Leif Uneus

    function stripcslashes()

    ExcludeTrailingPathDelimiter http://docwiki.embarcadero.com/Libraries/en/System.SysUtils.ExcludeTrailingPathDelimiter
  22. Leif Uneus

    Forked VSCode for Delphi

    The Delphi IDE known as Galileo (.NET inspired) has 15+ years on its neck. The tools to build and support the IDE is somewhat outdated and the Rio IDE is the first attempt in years to remove old dependencies.
  23. Leif Uneus

    Forked VSCode for Delphi

    The code editor works for me. I still use the Wordstar keyboard shortcuts as I did in the beginning of the 80s, programming in CP/M and then the MS-DOS environment. I turn off code completion, since that slows down typing and disrupts my intention more that it helps. My fingers do the typing, while I can concentrate on the code. The form designer is ok for layout. But there is one big shortcoming with how it lures a novice programmer to make a mess of separating the GUI from business logic. I wish a more sophisticated default scheme would be introduced to handle that. The error insight function is best turned off as well, since it introduces more doubts than it really helps. Comparing code is easy with the Beyond Compare plugin. The integration with different types of code repositories could be better. The debugger is fine and with the use of FastMM memory leaks are easy to find and remove. The biggest concern for me is not the state of the IDE. Every new version introduces errors in the compilers and the RTL. Using a new version in a 24/7 application is out of the question. I wish all Embarcaderos efforts could focus on bringing out quality compilers comparable with industry standard C++ compilers and a RTL that can be trusted.
  24. IDE Classic editor key mappings with Smart Surround Keys option disables the ctrl+G (delete key) shortcut. https://quality.embarcadero.com/browse/RSP-24277 "[Regression] Smart Surround Keys disables editor classic shortcut ctrl+G" Annoying, but unchecking the Smart Surround Keys option will make it work again.
×