comparison dyncall/dyncall.3 @ 577:864cf3c3ceb9

mdoc tweak
author Tassilo Philipp
date Thu, 08 Sep 2022 15:31:44 +0200
parents 53de6e16f445
children 1d4f0f516483
comparison
equal deleted inserted replaced
576:53de6e16f445 577:864cf3c3ceb9
375 .Bd -literal -offset indent 375 .Bd -literal -offset indent
376 struct S g(int, short); 376 struct S g(int, short);
377 .Ed 377 .Ed
378 .Pp 378 .Pp
379 Omitting creation of the 379 Omitting creation of the
380 .Sy DCaggr *a 380 .Sy DCaggr
381 .Ar *a
381 description, for simplicity: 382 description, for simplicity:
382 .Bd -literal -offset indent 383 .Bd -literal -offset indent
383 struct S s; 384 struct S s;
384 385
385 dcMode(vm, DC_CALL_C_DEFAULT); 386 dcMode(vm, DC_CALL_C_DEFAULT);
399 virtual void Klass::Method(float, int); 400 virtual void Klass::Method(float, int);
400 .Ed 401 .Ed
401 .Pp 402 .Pp
402 To keep the example simple, let's assume we have a pointer to this virtual 403 To keep the example simple, let's assume we have a pointer to this virtual
403 method in var 404 method in var
404 .Sy mptr 405 .Ar mptr
405 (e.g. grabbed from the instance's vtable), and a pointer to the instance in var 406 (e.g. grabbed from the instance's vtable), and a pointer to the instance in var
406 .Sy thisptr : 407 .Ar thisptr :
407 .Bd -literal -offset indent 408 .Bd -literal -offset indent
408 /* thiscall calling convention */ 409 /* thiscall calling convention */
409 dcMode(vm, DC_CALL_C_DEFAULT_THIS); 410 dcMode(vm, DC_CALL_C_DEFAULT_THIS);
410 dcReset(vm); 411 dcReset(vm);
411 /* C++ methods use this-ptr as first/hidden argument */ 412 /* C++ methods use this-ptr as first/hidden argument */