Jump to content

Kazantsev Alexey

Members
  • Content Count

    18
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Kazantsev Alexey


  1. 11 hours ago, Marus said:

    I need a safe way to allocate memory for a string variable, without getting exceptions. I don't want to use "try-except" blocks and neither the function that do this, use them internaly. I need a speed optimised method. If there are errors it can return a nil pointer.

     

    I checked the GetMem, AllocMem, GetMemory... and they all say that raise exceptions. Although I looked to the GetMemory code but I didn't see any code that raise exceptions. 

    You can use SysGetMem, SysReallocMem, SysFreeMem.


  2. Two cent about compilers performance by the example of spritz-c stream cipher implementation:

    spritz_delphi_fpc.thumb.png.52229db9c54f36941644b11aa8ac9c81.png

    1. Delphi 11, Windows x86_64 (classic compiler), release

    2. Delphi 11, Linux x86_64 (nextgen, LLVM based compiler), release

    3. FreePascal 3.3.1, Linux x86_64, release

    • Like 1

  3. 4 hours ago, Kazantsev Alexey said:
    
    library rtltest;
    //{$weaklinkrtti on}
    uses
     system.classes;
    begin
     TMemoryStream.Create.Free;
    end.

    Delphi XE2, x86_64, Release:

    default - 547840 bytes

    + weaklinkrtti on - 505344 bytes

    + custom rtl build with minimal rtti - 256000 bytes

    The same example on 10.4.2:
    1770kb, 1279kb, 456kb


  4. 1 hour ago, Fr0sT.Brutal said:

    How did you produce custom RTL build?

    For XE2 you need explicitly rebuild the three files (for latest versons need some more rtl files be rebuilded):
    system.pas (with key -Y)
    system.sysutils.pas (with key -V-)
    system.variants.pas (with key -V-)
    (search path should include rtl sources)

     

    When project building seach path should include your own custom rtl dcus, and rtl sources after it.

    • Like 1

  5. 1 hour ago, Fr0sT.Brutal said:

    I have x64 DLL that uses SysUtils and DateUtils weighting 590 Kb compiled with XE2.

    library rtltest;
    //{$weaklinkrtti on}
    uses
     system.classes;
    begin
     TMemoryStream.Create.Free;
    end.

    Delphi XE2, x86_64, Release:

    default - 547840 bytes

    + weaklinkrtti on - 505344 bytes

    + custom rtl build with minimal rtti - 256000 bytes

    • Like 1

  6. 7 hours ago, Anders Melander said:

    Um... Aren't you responsible for initializing the record yourself if you have declared an initializer for the record? 

    The error is not in the implementation of the custom initializer. A custom initializer is available for the “TRec” type, but an initialization error is in the “TData” type, which does not have a custom initializer, but has a field of a managed type. In the code example, you can replace the custom initializer with any other custom management operator (finalizer, assign), and you will get the same error.

    • Thanks 3

  7. 13 hours ago, fugitivox said:

    how would I change "SysColors.clHighlight" from version 10.3.2?

    1. Run any resource editor (ResourceHacker, for example) and open ModernTheme260.bpl
    2. Extract resource "WIN10IDE_LIGHT" to file *.vsf
    3. Open saved file in the Bitmap Style Designer ($(BDSBIN)\BitmapStyleDesigner.exe)
    4. In the tree-structure "Objects" find node "SysColors" and item "clHighlight"
    5. Change the "clHighlight" to you prefered color
    6. Save modified style and close Style Designer
    7. Using resource editor replace resource "WIN10IDE_LIGHT" in ModernTheme260.bpl by the modified style file.

     

    p.s. This issue planed to fix soon.

    • Like 1
    • Thanks 1
×