diff options
author | Mike Stump <mrs@apple.com> | 2005-03-22 02:14:33 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2005-03-22 02:14:33 +0000 |
commit | fb925a5148bd17de511f465415e7bce9dfca2f22 (patch) | |
tree | 8df46577f17af9fa0b049896e430ac8dbbf0e148 /libmudflap/mf-hooks1.c | |
parent | b025006799b4a7db62c13770d14a5211ce2b94e8 (diff) | |
download | gcc-fb925a5148bd17de511f465415e7bce9dfca2f22.tar.gz |
mf-heuristics.c: Fix whitespace at end of line.
* mf-heuristics.c: Fix whitespace at end of line.
* mf-hooks1.c: Likewise.
* mf-hooks2.c: Likewise.
* mf-hooks3.c: Likewise.
* mf-impl.h: Likewise.
* mf-runtime.c: Likewise.
* mf-runtime.h: Likewise.
From-SVN: r96850
Diffstat (limited to 'libmudflap/mf-hooks1.c')
-rw-r--r-- | libmudflap/mf-hooks1.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/libmudflap/mf-hooks1.c b/libmudflap/mf-hooks1.c index ba6bc959dd6..6f9d159e461 100644 --- a/libmudflap/mf-hooks1.c +++ b/libmudflap/mf-hooks1.c @@ -42,7 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #if !defined(__FreeBSD__) && !defined(__APPLE__) #define _POSIX_SOURCE #endif /* Some BSDs break <sys/socket.h> if this is defined. */ -#define _GNU_SOURCE +#define _GNU_SOURCE #define _XOPEN_SOURCE #define _BSD_TYPES #define __EXTENSIONS__ @@ -93,11 +93,11 @@ WRAPPER(void *, malloc, size_t c) void *result; BEGIN_PROTECT (malloc, c); - size_with_crumple_zones = + size_with_crumple_zones = CLAMPADD(c,CLAMPADD(__mf_opts.crumple_zone, __mf_opts.crumple_zone)); result = (char *) CALL_REAL (malloc, size_with_crumple_zones); - + if (LIKELY(result)) { result += __mf_opts.crumple_zone; @@ -142,23 +142,23 @@ WRAPPER(void *, calloc, size_t c, size_t n) DECLARE(void *, memset, void *, int, size_t); char *result; BEGIN_PROTECT (calloc, c, n); - - size_with_crumple_zones = + + size_with_crumple_zones = CLAMPADD((c * n), /* XXX: CLAMPMUL */ CLAMPADD(__mf_opts.crumple_zone, - __mf_opts.crumple_zone)); + __mf_opts.crumple_zone)); result = (char *) CALL_REAL (malloc, size_with_crumple_zones); - + if (LIKELY(result)) memset (result, 0, size_with_crumple_zones); - + if (LIKELY(result)) { result += __mf_opts.crumple_zone; __mf_register (result, c*n /* XXX: clamp */, __MF_TYPE_HEAP_I, "calloc region"); /* XXX: register __MF_TYPE_NOACCESS for crumple zones. */ } - + return result; } @@ -186,7 +186,7 @@ WRAPPER(void *, realloc, void *buf, size_t c) if (LIKELY(buf)) base -= __mf_opts.crumple_zone; - size_with_crumple_zones = + size_with_crumple_zones = CLAMPADD(c, CLAMPADD(__mf_opts.crumple_zone, __mf_opts.crumple_zone)); result = (char *) CALL_REAL (realloc, base, size_with_crumple_zones); @@ -199,9 +199,9 @@ WRAPPER(void *, realloc, void *buf, size_t c) __mf_opts.wipe_heap = 0; if (LIKELY(buf)) - __mfu_unregister (buf, 0, __MF_TYPE_HEAP_I); + __mfu_unregister (buf, 0, __MF_TYPE_HEAP_I); /* NB: underlying region may have been __MF_TYPE_HEAP. */ - + if (LIKELY(result)) { result += __mf_opts.crumple_zone; @@ -235,8 +235,8 @@ WRAPPER(void, free, void *buf) static void *free_queue [__MF_FREEQ_MAX]; static unsigned free_ptr = 0; static int freeq_initialized = 0; - DECLARE(void, free, void *); - + DECLARE(void, free, void *); + BEGIN_PROTECT (free, buf); if (UNLIKELY(buf == NULL)) @@ -245,7 +245,7 @@ WRAPPER(void, free, void *buf) LOCKTH (); if (UNLIKELY(!freeq_initialized)) { - memset (free_queue, 0, + memset (free_queue, 0, __MF_FREEQ_MAX * sizeof (void *)); freeq_initialized = 1; } @@ -270,14 +270,14 @@ WRAPPER(void, free, void *buf) { if (__mf_opts.trace_mf_calls) { - VERBOSE_TRACE ("freeing deferred pointer %p (crumple %u)\n", + VERBOSE_TRACE ("freeing deferred pointer %p (crumple %u)\n", (void *) freeme, __mf_opts.crumple_zone); } CALL_REAL (free, freeme); } - } - else + } + else { /* back pointer up a bit to the beginning of crumple zone */ char *base = (char *)buf; @@ -285,8 +285,8 @@ WRAPPER(void, free, void *buf) if (__mf_opts.trace_mf_calls) { VERBOSE_TRACE ("freeing pointer %p = %p - %u\n", - (void *) base, - (void *) buf, + (void *) base, + (void *) buf, __mf_opts.crumple_zone); } CALL_REAL (free, base); @@ -305,20 +305,20 @@ __mf_0fn_mmap (void *start, size_t l, int prot, int f, int fd, off_t off) #undef mmap -WRAPPER(void *, mmap, - void *start, size_t length, int prot, +WRAPPER(void *, mmap, + void *start, size_t length, int prot, int flags, int fd, off_t offset) { - DECLARE(void *, mmap, void *, size_t, int, + DECLARE(void *, mmap, void *, size_t, int, int, int, off_t); void *result; BEGIN_PROTECT (mmap, start, length, prot, flags, fd, offset); - result = CALL_REAL (mmap, start, length, prot, + result = CALL_REAL (mmap, start, length, prot, flags, fd, offset); /* - VERBOSE_TRACE ("mmap (%08lx, %08lx, ...) => %08lx\n", + VERBOSE_TRACE ("mmap (%08lx, %08lx, ...) => %08lx\n", (uintptr_t) start, (uintptr_t) length, (uintptr_t) result); */ @@ -363,11 +363,11 @@ WRAPPER(int , munmap, void *start, size_t length) DECLARE(int, munmap, void *, size_t); int result; BEGIN_PROTECT (munmap, start, length); - + result = CALL_REAL (munmap, start, length); /* - VERBOSE_TRACE ("munmap (%08lx, %08lx, ...) => %08lx\n", + VERBOSE_TRACE ("munmap (%08lx, %08lx, ...) => %08lx\n", (uintptr_t) start, (uintptr_t) length, (uintptr_t) result); */ @@ -387,7 +387,7 @@ WRAPPER(int , munmap, void *start, size_t length) /* This wrapper is a little different, as it's called indirectly from - __mf_fini also to clean up pending allocations. */ + __mf_fini also to clean up pending allocations. */ void * __mf_wrap_alloca_indirect (size_t c) { @@ -431,7 +431,7 @@ __mf_wrap_alloca_indirect (size_t c) result = NULL; if (LIKELY (c > 0)) /* alloca(0) causes no allocation. */ { - track = (struct alloca_tracking *) CALL_REAL (malloc, + track = (struct alloca_tracking *) CALL_REAL (malloc, sizeof (struct alloca_tracking)); if (LIKELY (track != NULL)) { @@ -451,7 +451,7 @@ __mf_wrap_alloca_indirect (size_t c) } } } - + return result; } |