Jump to content

Leif Uneus

  • Content Count

  • Joined

  • Last visited

Community Reputation

22 Excellent

Recent Profile Visitors

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

  1. Is it not enough to declare DefaultCW8087 et al. as threadvar?
  2. Leif Uneus

    RTTI in dpr / console app dpr

    Like using the $STRONGLINKTYPES directive? http://docwiki.embarcadero.com/RADStudio/en/Strong_link_types_(Delphi)
  3. 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
  4. 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)
  5. 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
  6. Leif Uneus

    Strange behavior for literals

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


    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
  8. You might be better off with this link to QP: https://quality.embarcadero.com
  9. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    Sorry @DavidHeffernan, but in the file posted by @pyscript his proposed function InterlockedCompareExchange128 returns a boolean.
  10. 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);
  11. 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.
  12. Leif Uneus

    Revisiting TThreadedQueue and TMonitor

    It is linked by @pyscripter a few replies above.
  13. 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/
  14. 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.