Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Round() appears to be non-deterministic

    There's no silver bullet here. You have to find every call that can potentially change the control state, and restore it when that call returns. Plus you've got the broken Delphi RTL which means that a change of control state in one thread can leak into another thread. It's worse on x64 than x86. I've discussed this here many times before. Emba know about the issues and have chosen not to address them. I've told them how to fix the issues in the RTL. In my code base I've replaced a number of RTL functions with thread safe versions, and added protection for whenever my code calls into external libraries. No silver bullet.
  2. David Heffernan

    Round() appears to be non-deterministic

    Could be all sorts of things. Calling almost any external module could change the control state. It's very hard to track it down.
  3. David Heffernan

    Round() appears to be non-deterministic

    Round is deterministic. Remember though that its input is its argument, and the floating point control state.
  4. David Heffernan

    The Case of Delphi Const String Parameters

    That would then be a race condition between the copy and the modification. That seems like the far bigger issue.
  5. David Heffernan

    The Case of Delphi Const String Parameters

    Nothing to see here. Carry on using const for string parameters. The issue is vanishingly rare. If you encounter the issue, fix it. Don't go changing existing code unless you are actually affected by the issue.
  6. Not so. In fact set of Char is actually implemented as set of AnsiChar. It has very special treatment introduced to "help" porting from ANSI Delphi to Unicode Delphi.
  7. David Heffernan

    Popup window with focus inside.

    Is your question, "is it possible to change the focus without changing the active window?"
  8. Unfortunately Emba never implemented proper generics support for sets which would make this trivial and type safe.
  9. The issue is that you need to write this code for every single set type that you use.
  10. There is another issue here, which is that you check bits that are unused, it the base type has number of members not divisible by 8. Probably you get away with it because it's probably hard to get 1 in any of the unused bits in a set.
  11. Thinking again, the specifics are important here, the use of an untyped parameter that is overload with an absolute variable. This basically renders range checking close to useless, because of the unsafe typecast.
  12. That's wrong. The code reads absolute aSet rather than absolute aByte. Consequently this statement is also incorrect. aSet could be on the stack, or the heap, or a global. In any case, I took the question a bit more generally than you. Accessing arrays out of bounds can lead to AVs or corruption of other memory in the case of a write operation. Yes, I know that the example here is a read. I was generalising.
  13. Behaviour is undefined. You might get an AV, or a write might corrupt data. Definitely not graceful failure.
  14. David Heffernan

    How can I implement DLLs in my code?

    Your code doesn't load a dll. You have an abstract virtual method that is never implemented. You are trying to run before you can walk. You aren't going to learn anything useful this way. You need to go back to the basics.
  15. Enumerate the members of interest and persist them. If these classes are really that simple, what is the difficulty? What are you stuck with? Using the RTTI? Or working with INI files?
  16. David Heffernan

    Can an app beat a spreadsheet?

    Talk to other people and see what they want.
  17. David Heffernan

    Example of wasteful, innefficient string manipulation

    This was from the original post. I suspect you meant to say fragmented rather than defragmented. When I asked how you assessed fragmentation you said that you hadn't, and that you didn't understand virtual memory. I don't know what you think you have demonstrated, but I don't think you have demonstrated anything at all.
  18. David Heffernan

    Example of wasteful, innefficient string manipulation

    What's the point? You've already reached a false conclusion based on a flawed investigation. If we try to point this out you tell us that you aren't interested in learning the truth.
  19. David Heffernan

    Example of wasteful, innefficient string manipulation

    Why aren't you curious to learn about how virtual memory works? Why aren't you curious to learn how sub-allocating memory managers work? Why aren't you curious to learn what address space fragmentation is?
  20. David Heffernan

    Example of wasteful, innefficient string manipulation

    I understand that you'd like that conclusion. It would be nice if it were true though. It isn't.
  21. David Heffernan

    Example of wasteful, innefficient string manipulation

    If you don't know about address space fragmentation, don't you wonder whether or not it is relevant?
  22. David Heffernan

    Example of wasteful, innefficient string manipulation

    Are you measuring address space fragmentation?
  23. It's just calling methods and accessing attributes. No different for pandas than for any other library.
  24. David Heffernan

    Example of wasteful, innefficient string manipulation

    Delphi's memory manager is fastmm. Also, your tool to measure the effect of the program isn't really telling you anything. It says nothing about fragmentation of address space. Virtual memory is a very complex subject. I suspect you need to learn more of the details before you can reason about your program.
×