Re: operator new with C++ and pthreads

2001-02-10 Thread John Wilson
You are absolutely right, that `inline' shouldn't have been there. My bad. It works now - thanks! John On Sat, 10 Feb 2001 15:51:35 -0800 (PST), Jean-Marc Zucconi wrote: > > John Wilson writes: > > > - > > my_new.cc > > - > > > #include > > #include >

Re: operator new with C++ and pthreads

2001-02-10 Thread Warner Losh
In message <[EMAIL PROTECTED]> John Wilson writes: : inline void *operator new(size_t size) This causes no code to be generated. Remove inline. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

Re: operator new with C++ and pthreads

2001-02-10 Thread Warner Losh
In message <[EMAIL PROTECTED]> John Wilson writes: : but gcc (g++) doesn't seem to want to link them in, and uses its own : __builtin_new and __builtin_delete instead. we do this all the time. g++ foo.o -o foo -pthreads -static works great. You must use g++ and not gcc to like, or you

Re: operator new with C++ and pthreads

2001-02-10 Thread Jean-Marc Zucconi
> John Wilson writes: > - > my_new.cc > - > #include > #include > #include "my_new.h" > inline void *operator new(size_t size) > { > printf("my new was called with size = %u\n", size); > return malloc(size); > } This is stupid. Inline function

Re: operator new with C++ and pthreads

2001-02-10 Thread John Wilson
Thanks for your reply, Jordan. -fno-builtin doesn't seem to work. Consider the following simple scenario: my_new.h #include inline void *operator new(size_t size); - my_new.cc - #include #include #include "my_new.h" inline void *operator new(size_t s

Re: operator new with C++ and pthreads

2001-02-10 Thread Jordan Hubbard
> but gcc (g++) doesn't seem to want to link them in, and uses its own > __builtin_new and __builtin_delete instead. You need to compile everything with -fno-builtin so that g++ won't try to use its own versions but yours instead. - Jordan To Unsubscribe: send mail to [EMAIL PROTECTED] with "u

operator new with C++ and pthreads

2001-02-09 Thread John Wilson
Hello, fellow hackers, I have written my own little memory management system optimized for the needs of a multi-threaded server written in C++.I have defined my own inline void* operator new(size_t size) and inline void operator delete(void *ptr) but gcc (g++) doesn't seem to want to link