delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/06/10:37:22

Message-ID: <D1FB30BBA491D1118E6D006097BCAE39225EC3@Probe-nt-2a.Probe.co.uk>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: stdcall vs cdecl (-mrtd switch)
Date: Mon, 6 Apr 1998 15:37:01 +0100
MIME-Version: 1.0

Alberto Chessa writes:
> There is a way to use -mrtd with the standard library or I have to 
> get lib source and recompile ?

It's actually even worse than just having to recompile libc, because
some functions (eg. most of the __dpmi_*() routines) are coded in asm.
You will need to modify all these before it can work with a different
calling convention.

If I remember correctly, someone did some research about this a year 
or so ago, so you may be able to find some useful info in the mail
archives. I think that after running some tests they discarded the
plan, though, because they found very little difference between the
stdcall and the register-based convention. Passing parameters via
registers is only a real saving if you have enough registers to do
it properly: with only six general registers in the Intel, I suspect
you will find that stdcall is perfectly efficient for anything 
longer than a couple of lines (very small functions should of course 
be inlined).

	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019