Jump to content
Registration disabled at the moment Read more... ×

David Heffernan

Members
  • Content Count

    3715
  • Joined

  • Last visited

  • Days Won

    186

Posts posted by David Heffernan


  1. 4 hours ago, Stefan Glienke said:

    That's what the madCompileBugReport tool is for - you use madExcept with minimal debug info then the bugreport the application produces does not contain function names and such but using the tool turns it back into that - you need to have archived the map files for your released binaries though.

    Yes, this is precisely what I currently do


  2. Encrypting the map file, and then decrypting on runtime doesn't add much security. Your map file would be readily reversible by any moderately skilled hacker. If you want to keep the map file private, don't add it to your exe and decode the stack trace addresses into method names when the bug report is sent to you. 


  3. 5 minutes ago, Hafedh TRIMECHE said:

    I guess that is a Reallocation problem!

    The code changed to:

    
      SetLength(Result,0);
      SetLength(Result,OutLen);
    


    solved the problem. But it's at a higher risk: Result content would be lost when setting length to 0.

    That doesn't change anything. That is just wasteful. We know that dynamic arrays work correctly. If you really want to resolve the problem you need to clearly identify it first.


  4. 1 hour ago, Mike Torrettinni said:

    Yes, I think I will go for it. Current 32GB was enough, but got close to the max often. So, 64GB should be enough for next 5 years or so.

    Using all your memory doesn't necessarily mean that your computer would be slower with less. It usually just means that your computer is making the disk cache as large as possible. 


  5. I don't see l any good reason why the IDE stability would have anything to do with hardware. It's just bug ridden. 

     

    Those AMD processors are pretty tasty. Gamers love them. But they are way over powered for Delphi. Most important thing you can do for Delphi IDE perf is have a good SSD. 

    • Like 1

  6. 8 minutes ago, Anders Melander said:

    While I completely agree with David's considerations it should be noted that the startup cost of an in-process COM server is considerably smaller than that of of an out-of-process COM server. For an in-process server it's basically just the cost of setting up the COM apartment. For an out-of-process server there's also the cost of launching the process.

    I meant the startup cost for the developer to learn how to create and maintain and deploy com servers. 


  7. Whether you opt for pinvoke or a COM server depends very much on what the interface surface area looks like. I don't think anybody can give you a valid recommendation without knowledge of that.

     

    Broadly speaking, for more larger and more complex interfaces, then a COM server may be preferable. For simpler interfaces, then p/invoke may be preferable. It is more effort to setup a COM server (especially if you have to learn COM), but having done so the coding on both sides will likely be simpler. For larger and more complex interfaces the startup cost of a COM server will yield time savings to offset that. For an interface that can be represented by a small number of functions, then you will never recover that startup cost, hence why p/invoke would win.

     

    To my mind at least those are the main factors to consider in your decision.

    • Like 1

  8. What other tools use pdb? I think pdb files can be used to get stack traces in Process Explorer and Process Hacker 2. Obviously there is Visual Studio and there must be many others. I wonder if anybody has tried using the pdb files generated by map2pdb with other tools such as these. 


  9. 3 hours ago, vfbb said:

    All manipulations of strings received by user input should consider each element and not each individual character. This is basically why delphi TEdit does not work properly with these kind of emojis (just try adding one and pressing backspace that you will see part of problem). In short, when you don't consider this, you risk breaking a string into a position in the middle of a Grapheme, creating a malformed string.

     

    As I said, this iteration is essential, Embarcadero should implement this natively to work cross-platform just like C # did.

     

    The best thing to do at this point is to port the C # code.

    I don't think this is true. TEdit is the Win32 EDIT control. What are you doing with strings that need to know what you are asking about? What's your usage scenario? 

    • Like 1

  10. 36 minutes ago, Fr0sT.Brutal said:

    FastMM already reserves some space after a string/array so manual reservations are unneeded where it is used. F.ex., the following test case

     

    
    procedure TForm1.Button2Click(Sender: TObject);
    var arr: array of byte;
    i: Integer;
    begin
      for i := 0 to 30 do
        SetLength(arr, length(arr)+1);
    end;

    only caused four reallocations

    Isn't that going to claim a global lock 31 times?

×