turning off malloc output
turning off malloc output
- Subject: turning off malloc output
- From: Alexander Peyser <email@hidden>
- Date: Thu, 04 Jan 2007 22:28:29 -0500
I was looking for a way to turn of malloc debugging for a program that
test for a malloc failure. The same question went unanswered in
http://lists.apple.com/archives/projectbuilder-users/2002/Nov/msg00179.html:
* Subject: turning off malloc warnings
* From: Andrew Scheck <email@hidden>
* Date: Fri, 22 Nov 2002 13:17:14 -0500
This Makefile snippet:
libnomalloc_printf.dylib: nomalloc_printf.c
$(CC) $(CFLAGS) -dynamiclib -o $@ $<
tester: tester.c libnomalloc_printf.dylib
$(CC) $(CFLAGS) -Wall \
-force_flat_namespace -bind_at_load \
-L. -lnomalloc_printf \
-o $@ $<
where nomalloc_printf.c just contains:
void malloc_printf(const char* format, ...)
will shut malloc up. This appears to be the minimum set.
Is there some way to turn the malloc definitions into weak references
and avoid this complication (such as force_flat_namespace)? Make these
functions into variables, and name them uniquely in each library? In
general, each library should be able to override mallocs, and have
theirs overridden uniquely -- see the regex library for an exercise in
malloc frustration.
begin:vcard
fn:Alexander Peyser
n:Peyser;Alexander
email;internet:email@hidden
x-mozilla-html:TRUE
version:2.1
end:vcard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden