This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Remove wrapper functions in pthread.cc
- From: Vaclav Haisman <V dot Haisman at sh dot cvut dot cz>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 20 Mar 2003 01:11:38 +0100 (CET)
- Subject: Re: [PATCH] Remove wrapper functions in pthread.cc
I see this patch removes one unnecessary function call. I think we might be
able to remove one more function call from pthread_* functions to pthread::*
functions. I think it could be possible using GCC's feature of emitting aliases
of functions. This has unfortunately an inconvenience, one needs to have a
mangled C++ function name to be able to define the alias properly. I tryed this
simple test but haven't investigated it more thoroughly.
Vaclav Haisman
#include <cstdio>
void f ()
{
printf ("f()\n");
}
void g () __attribute__ ((alias ("_Z1fv")));
class A {
public:
static int static_func (int);
};
int A::static_func (int x)
{
printf ("A::static_func()");
return 1;
}
extern "C" int global_func (int) __attribute__ ((alias
("_ZN1A11static_funcEi")));
int main ()
{
g ();
global_func (1);
}