-
Content Count
3536 -
Joined
-
Last visited
-
Days Won
175
Posts posted by David Heffernan
-
-
CAS from OTL does restore rbx, but it should do so using .pushnv, for the reasons that Allen's article explains.
-
1
-
-
8 hours ago, Kas Ob. said:The assembly is good and had nothing to be fixed.
No it is not. It modifies rbx and does not restore it.
-
11 minutes ago, Anders Melander said:Regardless the obstacle is probably more a question of resources and priorities.
This is the point that I've been making all along.
-
1
-
-
33 minutes ago, Vandrovnik said:I believe Anders is right.
Class reference is just a pointer - its size is known. When you use this class as a member of another class (fChild: tChild, where tChild is a class), you cannot reference its members in properties (property x: integer read fChild.x). If fChild is a record (fChild: tChild, where tChild is a record), you can reference its members in properties, like in Anders' example (property x: integer read fChild.x).
Not being able to do that one thing would hardly invalidate the entire enterprise. We'd still be able to use the type as procedure argument which is the main thing we are striving for.
But the whole argument is predicted on this single pass. It's no big deal to pass over each type section twice to process forward declarations. Won't make a blind bit of difference to performance.
Bottom line is that it is perfectly possible to do this if Emba wanted to.
-
55 minutes ago, Anders Melander said:It isn't. The type and offset of the members needs to be known too:
type TMyRecord = record Foo: integer; Bar: string; end; TMyClass = class private FFooBar: TMyRecord; public property Foo: integer read FFooBar.Foo; property Bar: string read FFooBar.Bar; end;
If what you say were true, then class forward references would not exist.
-
I can't see where RBX is restored in that InterlockedCompareExchange128 code. It's a NV register. Function needs to start with .PUSHNV RBX
I can't vouch for the rest of what it does.
-
12 hours ago, pyscripter said:Whilst still not perfect it helps a lot in 32 bits with say up to 100 threads.
You can't be doing multithreaded programming where "whilst still not perfect" as a valid statement. It's got to be right.
-
Not sure it's relevant but that x64 should use .PUSHNV to preserve rbx. And I think that also makes .NOFRAME incorrect.
-
1
-
-
6 minutes ago, Tntman said:is there any explanation for that strange behavior ?
The FMX bitmap that you save is a compressed bitmap. The VCL bitmap is a Windows bitmap, uncompressed.
-
1
-
-
I don't think that mixing VCL and FMX will work. So I'd just rule that out.
-
Wouldn't it just be easier to detect the webcam without trying to mix FMX into the system?
-
20 minutes ago, Anders Melander said:You are not stuck.
With over a million lines of code, it's an epic task to migrate.
22 minutes ago, Anders Melander said:This problem can be solved, with certain limitations, while still staying a one-pass compiler, but at a cost of added complexity in the compiler and longer compile time.
I can't believe that the increase in compiler time would be significant.
-
1
-
-
53 minutes ago, Sherlock said:A second rate language that compiles fast as hell...at least for Windows. Now I wonder why 😉
C# compilation is pretty darn fast. Delphi compilation for 64 bit on Windows is not exactly fast.
I'm sure that a first pass to define record type layouts followed by a second pass for everything else would not be costly.
This isn't going to be about compilation speedy. It's about the pain of refactoring the front end.
-
2
-
-
3 hours ago, Bernard said:Could you elaborate on why it is not possible?
It is possible. Plenty of languages can handle this. Emba could implement it if they chose to.
-
7 minutes ago, Remy Lebeau said:Yeah, THAT is not going to happen anytime soon, either.
Well no, of course not. So we are stuck with this second rate language.
-
10 minutes ago, Anders Melander said:Without access to the compiler source it's hard to tell, but I'll bet there are some.
For one, as far as I can tell, it would require forward declaration of the record and I know there are good reasons why that isn't possible.How would you envision forward declaration of a record method would look?
The argument is that its a single pass compile. So make it two pass. Simples.
-
1
-
1
-
-
2 hours ago, Remy Lebeau said:Not going to happen. You can't forward-declare records.
You should be able to forward declare their methods. No reason not to be able to do that.
-
28 minutes ago, Bernard said:It would be great with all the record enhancements in the next version to be able to write
tPoint2D = record;
tPolar2D = record
Radius: Double;
azimuth: Double;
function ToCartesian: tPoint2D;
end;tPoint2D = record
x: Double;
y: Double;
function ToPolar: tPolar2D;
end;Thanks again for the feedback
Bloody annoying that this can't be done
-
3
-
-
I personally don't think you can do better than helpers. That's what I do.
-
1
-
-
7 hours ago, Kas Ob. said:I think it does matter
You think wrong
-
Find out by debugging. Set a breakpoint on SetLastError. And inspect the call stack when it triggers.
-
The only error here is the code that calls GetLastError and uses the value at a time when its return value is meaningless. All you have to do is to stop doing that.
-
3
-
-
18 minutes ago, Vandrovnik said:I was surprised to see typecast "integer(pointer(..." in https://blog.marcocantu.com/blog/2020-may-custom-managed-records.html ...
Yeah, should be using '%p' format string
-
1
-
-
15 minutes ago, Vandrovnik said:64 bit IDE would probably require all design time packages to be 64 bit, too...
Sure. But so what?
Revisiting TThreadedQueue and TMonitor
in RTL and Delphi Object Pascal
Posted · Edited by David Heffernan
Wrong. It also lets the compiler out the meta data, the unwind data, needed to restore the register in case of an exception. Read Allen's article.