Jump to content

David Heffernan

Members
  • Content Count

    3701
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. David Heffernan

    class operator, AND/OR/XOR question

    It's explained in the documentation. Which should always be the first port of call when contemplating such an issue. Its here: http://docwiki.embarcadero.com/RADStudio/en/Operator_Overloading_(Delphi) I could highlight the key text for you, but I'm sure you are more than capable of finding it.
  2. David Heffernan

    How do you identify bottleneck in Delphi code?

    Your conclusion in that topic is wrong. You can make huge algorithmic gains but you choose not to. I've no idea why not.
  3. David Heffernan

    Quickly zero all local variables?

    It's passed by value in your procedure. The caller can't see the change. Also, the original concept would be something that would zeroise local vars without them needing to be listed. Your code fails in every possible way to meet the requirements. And indeed any user defined function would fail, because the asker wants to have the compiler do it.
  4. David Heffernan

    Quickly zero all local variables?

    Why would anybody use code that does nothing? You call a procedure passing parameters by value. Then that procedure modifies those parameters. You've basically done this: procedure Foo(Value: Integer); begin Value := 0; end; I don't think it takes a genius to see that this is pointless. Furthermore, were your function able to do what you think it can, it's still useless. Who the heck is going to call a procedure passing a list of variables, to have that procedure set them to zero? You'll just set them to zero at the call site using the assignment operator. You really think people are going to write: prcInitItPlease([lMyVarLocalThiProc, lMyOtherVarLocal]); (which does not and cannot work as noted above) rather than lMyVarLocalThiProc := 0; lMyOtherVarLocal := 0; Honestly, this thread is mind boggling!
  5. David Heffernan

    Quickly zero all local variables?

    This just modifies local copies of the args, not before burning a ton of cycles boxing them in variants.
  6. David Heffernan

    How do you identify bottleneck in Delphi code?

    This is for sure worth doing. But is that what you mean when you talk about a 10% improvement above? Or are you measuring 10% in just a single function? And sorry to hark back to it, but in your StringReplace topic recently you were concentrating on utterly the wrong thing. There was a massive opportunity to optimise that code, and you have chosen not to take it. For reasons that escape me.
  7. David Heffernan

    How do you identify bottleneck in Delphi code?

    @Mike Torrettinni when you talk about a 10% improvement, do you mean in the execution time for one function, or do you mean the overall execution time for the program, or perhaps the user visible task within the program?
  8. David Heffernan

    Quickly zero all local variables?

    It doesn't exist. You'd have to ask Embarcadero. Only they can make it happen.
  9. David Heffernan

    Quickly zero all local variables?

    Because doing so does take time. For sure it won't be noticeable for most functions, but for tiny leaf functions in hotspots, it can be. You realistically are not going to add code manually to every single function you write to do this. The compiler can't do it. Everything else is just noise in this thread.
  10. David Heffernan

    Quickly zero all local variables?

    I can't believe that anybody would use such code in real programs. Wouldn't it just be better to initialise your local variables?
  11. David Heffernan

    Quickly zero all local variables?

    Not going to be an easy way to do what you ask and I doubt it would address the real problem.
  12. David Heffernan

    Create a Delphi Dll and load it with DllMain

    It's still not clear. Are you wanting to use the CreateRemoteThread technique, where you allocate memory in the victim process which contains the name of your DLL and then your thread procedure calls LoadLibrary?
  13. David Heffernan

    Create a Delphi Dll and load it with DllMain

    Can you describe what injection technique you plan to use, and what you have achieved so far. Also, don't try to work on this with the production DLL. Work with a simple do nothing DLL so that you can test one thing at a time.
  14. David Heffernan

    Undocumented language enhancements

    Obviously I know this and have read it plenty of times. But it's way short of a formal specification. Just read the topic for properties. What does fieldOrMethod mean? It's not precisely defined anywhere. The entire language documentation is like that. Just a little imprecise.
  15. David Heffernan

    Undocumented language enhancements

    The entire language is essentially undocumented. There is no formal specification, no documented grammar etc.
  16. It's called the interface contract. It relies on an agreement between callee and caller, rather than hope.
  17. I think @Lars Fosdal had in mind a post or article with a definitive statement that exhaustively covers every form of variable.
  18. Perhaps you'd like to explain how you go about implementing an atomic increment function without using a var parameter. Which seems to be what you are advocating.
  19. Gonna be hard to implement an atomic increment without using a var parameter. Perhaps if people want to talk about the issue of whether certain variables are aligned, then perhaps a new topic would be better.
  20. David Heffernan

    (Hole) align hole inside the panel form 1

    Please don't spam the site with duplicate posts. When you do post, please don't use ultra large text.
  21. It's impossible to draw any conclusions from this declaration. This isn't code that executes. It's just the signature of a procedure. Its kinda tedious that you have said over and over that your data is aligned but people keep coming back to say "your data has to be aligned."
  22. The alignment requirement has been stated many times in this topic. It's doesn't need to be repeated.
  23. What is the question here? Is it, "is this operation atomic for aligned data?" Or is it, "what are the rules for determining whether or not data is aligned?"
  24. David Heffernan

    convert Procedure to a Unit??

    The documentation explains what a unit is in Delphi
  25. David Heffernan

    The TDIFF component -does not work in 64 bit compiled app

    This is something that crops up over and again. Always get third party libraries from their main repos, and make sure you are up to date.
×