Jump to content

David Heffernan

Members
  • Content Count

    3711
  • Joined

  • Last visited

  • Days Won

    185

Posts posted by David Heffernan


  1. This __imp_ mangling, IIRC, is used by ms tools when linking using a import lib. Delphi links to DLLs in a different way. Not sure if the difference is important.

     

    If it were me I'd compile each source file individually using cl and then link those.

     

    Although I don't like to do that very much. It's tempting to be able to link objects statically. But it's fraught with difficulties. It's fiddly. And under x64 you have a further problem. The Delphi compiler doesn't respect the meta data in the object file describing the exception tables. So if exceptions are raised in the linked C code, then it's common for the process to be terminated forcefully.

     

    These days I always prefer to link to DLLs using an sxs assembly to avoid problems with dll search paths. 


  2. 20 minutes ago, Lars Fosdal said:

    It doesn't need to be complicated. 

     

    If the type of the variable you reference by with contains a field or property that has the same name as a local field or property - you do not get a hint or a warning, but the property set will be the on the with reference, not on the class instance doing the with reference.

     

    All problems relating to with could be solved by the compiler warning about such collisions. 

    • Like 1

  3. 3 hours ago, Gary Wardell said:

    What should I change so I can get a helpful answer?

    More clarity in the question. Full details of error, and a minimal reproduction. And don't post criticism for not receiving a response immediately. That does not motivate people. 


  4. 8 hours ago, Gary Wardell said:

    Hmm, 23 views and nobody knows what FMX files are or where they are from or how to add them to the library files so they can be found?

    Not sure this approach is helpful. 


  5. 19 minutes ago, Vincent Parrett said:

    My records have constructors, I'm guessing that now makes them managed records

    No I don't think it does make them managed records. 

     

    I don't really understand how such simple code could break the compiler. It's as if Embarcadero don't have comprehensive tests in place. 

    • Like 3
    • Confused 1

  6. 24 minutes ago, Kas Ob. said:

    In C/C++ it way easier to convert a simple bufferflow into security hole, let you take over the system in full if not only the application, parameters passed in registers and memory allocated buffer along with the way stack in Delphi preserve itself with the locals, makes it way harder to run code passed by a parameter, unlike C and many other languages there is many ways to do it, and it is easier and and even when you are expert programmer, the candidate code to be abused code can easily escape your eyes and mind, the stack is the cause in 90% of those security holes you see in an application/OS written in C/C++. while the stack is sacred and better protected against simple and complex abuse in Delphi, i am not saying it is impossible to do an abuse, but it is near impossible to predict the abuse outcome, mostly it will end up in AV at random address, defusing the greater lost by running hand crafted malicious code.

    This is just not true.

    • Like 1

  7. 1 hour ago, Kas Ob. said:

    See, pascal/Delphi is more secure than C++ and C#, less than Rust

    Security is not a property of the language. It's a property of the code. And the code is written by programmers. They determine how secure a piece of code is, not the choice of language.

     

    1 hour ago, Kas Ob. said:

    it is secure for many reason but mostly due the declaration of variables before using them when entering procedure

    Hard to see how that brings security. 


  8. 1 hour ago, Mike Torrettinni said:

    Interesting stuff: asm, registries, aligning... it's like a black-box to me. Reading how little insignificant changes (order of functions calls) affect the performance, is kind of scary.

     

    But it shows how real performance optimization is based on case by case. It's hard (or impossible) to make 1 super performant algorithm for all cases. Just from this thread we can see the differences on optimization for short vs long strings, or like @aehimself pointed out if we need to consider nested brackets, escaped chars, quoted chars...

     

    Here I am thinking if increasing char pointer is faster than using integer iterator, while you guys are discussing condition branching and using stack and full set of registries 🙂

    Do you have a performance bottleneck with this code?


  9. 14 hours ago, River_Forest said:

    Is there an easy way to add scrollbars to the main window of my project? (I hope this is the right place to post this question. Also, as a user of the Community Edition, it appears that I don't have access to "Help," so I can't find the answer there.) I thought something might be listed in "Properties," but I'm not seeing it there.

    You can get help in the community version I believe. But in any case it's all online. 

×