Re: free in C++?
Martijn van Buul <[email protected]> Sun, 3 Feb 2008 19:02:54 +0000 (UTC)
| Newsgroups | gmane.os.netbsd.help |
|---|---|
| Organization | Eindhoven University of Technology |
| Message-ID | <[email protected]> |
* James K. Lowden: > Is malloc_options supposed to work in C++? I have this message: Probably, operator new/delete will in all likelyhood call malloc/free eventually, but keep in mind that it's possible to overload these. > The free manpage indicates this is a libc diagnostic. Trying to follow > directions, I put > > extern char *malloc_options; The manpage calls for _malloc_options. Note the leading underscore. Also, since you're calling this from C++, you will need to explicitly tell it to use C linkage. This is not a NetBSD issue, but a C-vs-C++ issue. try extern "C" char *_malloc_options; char *_malloc_options = "X"; This works for me; at least "J" does what it's supposed to do. -- Martijn van Buul - [email protected]