This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] malloc: Lindent public_fREe()
- From: Joern Engel <joern at purestorage dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Joern Engel <joern at purestorage dot org>
- Date: Mon, 25 Jan 2016 16:25:04 -0800
- Subject: [PATCH] malloc: Lindent public_fREe()
- Authentication-results: sourceware.org; auth=none
- References: <1453767942-19369-1-git-send-email-joern at purestorage dot com>
From: Joern Engel <joern@purestorage.org>
JIRA: PURE-27597
---
tpc/malloc2.13/malloc.c | 44 ++++++++++++++++++++------------------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/tpc/malloc2.13/malloc.c b/tpc/malloc2.13/malloc.c
index ddc9d51c445b..83d2c4c02e48 100644
--- a/tpc/malloc2.13/malloc.c
+++ b/tpc/malloc2.13/malloc.c
@@ -3252,8 +3252,7 @@ Void_t *public_mALLOc(size_t bytes)
struct malloc_state *ar_ptr;
Void_t *victim;
- __malloc_ptr_t(*hook) (size_t, __const __malloc_ptr_t)
- = force_reg(dlmalloc_hook);
+ __malloc_ptr_t(*hook) (size_t, __const __malloc_ptr_t) = force_reg(dlmalloc_hook);
if (hook != NULL)
return (*hook) (bytes, RETURN_ADDRESS(0));
@@ -3270,34 +3269,31 @@ Void_t *public_mALLOc(size_t bytes)
return victim;
}
-void
-public_fREe(Void_t* mem)
+void public_fREe(Void_t * mem)
{
- struct malloc_state * ar_ptr;
- mchunkptr p; /* chunk corresponding to mem */
+ struct malloc_state *ar_ptr;
+ mchunkptr p; /* chunk corresponding to mem */
- void (*hook) (__malloc_ptr_t, __const __malloc_ptr_t)
- = force_reg (dlfree_hook);
- if (hook != NULL) {
- (*hook)(mem, RETURN_ADDRESS (0));
- return;
- }
+ void (*hook) (__malloc_ptr_t, __const __malloc_ptr_t) = force_reg(dlfree_hook);
+ if (hook != NULL) {
+ (*hook) (mem, RETURN_ADDRESS(0));
+ return;
+ }
- if (mem == 0) /* free(0) has no effect */
- return;
+ if (mem == 0) /* free(0) has no effect */
+ return;
- p = mem2chunk(mem);
+ p = mem2chunk(mem);
- if (chunk_is_mmapped(p)) /* release mmapped memory. */
- {
- munmap_chunk(p);
- return;
- }
+ if (chunk_is_mmapped(p)) { /* release mmapped memory. */
+ munmap_chunk(p);
+ return;
+ }
- ar_ptr = arena_for_chunk(p);
- arena_lock(ar_ptr);
- _int_free(ar_ptr, p);
- arena_unlock(ar_ptr);
+ ar_ptr = arena_for_chunk(p);
+ arena_lock(ar_ptr);
+ _int_free(ar_ptr, p);
+ arena_unlock(ar_ptr);
}
Void_t*
--
2.7.0.rc3