diff options
author | Volker Lendecke <vl@samba.org> | 2013-04-15 21:44:38 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-03-15 22:14:07 +0100 |
commit | 61150fb12de1941537154c792a6db4a00f47b6c4 (patch) | |
tree | c38f95d74f1ba00653e039f67e5ebad478ec9f9c | |
parent | 856220d329f1b58a06c0dcb13acf6cfe9c4e69fc (diff) | |
download | samba-61150fb12de1941537154c792a6db4a00f47b6c4.tar.gz |
talloc: Fix nonblank line endings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d3928b0c8af01f7751191b81a72590ca35751a8c)
-rw-r--r-- | lib/talloc/talloc.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 3e33fc0fad5..d0c81d3d43a 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -1,4 +1,4 @@ -/* +/* Samba Unix SMB/CIFS implementation. Samba trivial allocation library - new interface @@ -7,11 +7,11 @@ Copyright (C) Andrew Tridgell 2004 Copyright (C) Stefan Metzmacher 2006 - + ** NOTE! The following LGPL license applies to the talloc ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -74,7 +74,7 @@ #define TALLOC_MAGIC_REFERENCE ((const char *)1) -/* by default we abort when given a bad pointer (such as when talloc_free() is called +/* by default we abort when given a bad pointer (such as when talloc_free() is called on a pointer that came from malloc() */ #ifndef TALLOC_ABORT #define TALLOC_ABORT(reason) abort() @@ -367,7 +367,7 @@ static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr) { const char *pp = (const char *)ptr; struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - TC_HDR_SIZE); - if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) { + if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) { if ((tc->flags & (~0xFFF)) == TALLOC_MAGIC_BASE) { talloc_abort_magic(tc->flags & (~0xF)); return NULL; @@ -558,7 +558,7 @@ static struct talloc_chunk *talloc_alloc_pool(struct talloc_chunk *parent, return result; } -/* +/* Allocate a bit of memory as a child of an existing pointer */ static inline void *__talloc(const void *context, size_t size) @@ -675,7 +675,7 @@ _PUBLIC_ void _talloc_set_destructor(const void *ptr, int (*destructor)(void *)) } /* - increase the reference count on a piece of memory. + increase the reference count on a piece of memory. */ _PUBLIC_ int talloc_increase_ref_count(const void *ptr) { @@ -698,7 +698,7 @@ static int talloc_reference_destructor(struct talloc_reference_handle *handle) } /* - more efficient way to add a name to a pointer - the name must point to a + more efficient way to add a name to a pointer - the name must point to a true string constant */ static inline void _talloc_set_name_const(const void *ptr, const char *name) @@ -728,8 +728,8 @@ static inline void *_talloc_named_const(const void *context, size_t size, const make a secondary reference to a pointer, hanging off the given context. the pointer remains valid until both the original caller and this given context are freed. - - the major use for this is when two different structures need to reference the + + the major use for this is when two different structures need to reference the same underlying data, and you want to be able to free the two instances separately, and in either order */ @@ -818,7 +818,7 @@ static inline void _talloc_free_children_internal(struct talloc_chunk *tc, void *ptr, const char *location); -/* +/* internal talloc_free call */ static inline int _talloc_free_internal(void *ptr, const char *location) @@ -918,8 +918,8 @@ static inline int _talloc_free_internal(void *ptr, const char *location) /* we mark the freed memory with where we called the free * from. This means on a double free error we can report where - * the first free came from - */ + * the first free came from + */ tc->name = location; if (tc->flags & TALLOC_FLAG_POOL) { @@ -948,7 +948,7 @@ static size_t _talloc_total_limit_size(const void *ptr, struct talloc_memlimit *old_limit, struct talloc_memlimit *new_limit); -/* +/* move a lump of memory from one talloc context to another return the ptr on success, or NULL if it could not be transferred. passing NULL as ptr will always return NULL with no side effects. @@ -1037,7 +1037,7 @@ static void *_talloc_steal_internal(const void *new_ctx, const void *ptr) return discard_const_p(void, ptr); } -/* +/* move a lump of memory from one talloc context to another return the ptr on success, or NULL if it could not be transferred. passing NULL as ptr will always return NULL with no side effects. @@ -1049,9 +1049,9 @@ _PUBLIC_ void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const cha if (unlikely(ptr == NULL)) { return NULL; } - + tc = talloc_chunk_from_ptr(ptr); - + if (unlikely(tc->refs != NULL) && talloc_parent(ptr) != new_ctx) { struct talloc_reference_handle *h; @@ -1071,11 +1071,11 @@ _PUBLIC_ void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const cha talloc_log("WARNING: stealing into talloc child at %s\n", location); } #endif - + return _talloc_steal_internal(new_ctx, ptr); } -/* +/* this is like a talloc_steal(), but you must supply the old parent. This resolves the ambiguity in a talloc_steal() which is called on a context that has more than one parent (via references) @@ -1103,7 +1103,7 @@ _PUBLIC_ void *talloc_reparent(const void *old_parent, const void *new_parent, c } return discard_const_p(void, ptr); } - } + } /* it wasn't a parent */ return NULL; @@ -1403,7 +1403,7 @@ _PUBLIC_ void talloc_free_children(void *ptr) } } -/* +/* Allocate a bit of memory as a child of an existing pointer */ _PUBLIC_ void *_talloc(const void *context, size_t size) @@ -1429,8 +1429,8 @@ _PUBLIC_ void *talloc_named_const(const void *context, size_t size, const char * return _talloc_named_const(context, size, name); } -/* - free a talloc pointer. This also frees all child pointers of this +/* + free a talloc pointer. This also frees all child pointers of this pointer recursively return 0 if the memory is actually freed, otherwise -1. The memory @@ -1444,9 +1444,9 @@ _PUBLIC_ int _talloc_free(void *ptr, const char *location) if (unlikely(ptr == NULL)) { return -1; } - + tc = talloc_chunk_from_ptr(ptr); - + if (unlikely(tc->refs != NULL)) { struct talloc_reference_handle *h; @@ -1466,7 +1466,7 @@ _PUBLIC_ int _talloc_free(void *ptr, const char *location) } return -1; } - + return _talloc_free_internal(ptr, location); } @@ -1686,9 +1686,9 @@ _PUBLIC_ void *_talloc_realloc(const void *context, void *ptr, size_t size, cons } got_new_ptr: #endif - if (unlikely(!new_ptr)) { - tc->flags &= ~TALLOC_FLAG_FREE; - return NULL; + if (unlikely(!new_ptr)) { + tc->flags &= ~TALLOC_FLAG_FREE; + return NULL; } tc = (struct talloc_chunk *)new_ptr; @@ -1901,14 +1901,14 @@ static void talloc_report_depth_FILE_helper(const void *ptr, int depth, int max_ } if (depth == 0) { - fprintf(f,"%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", + fprintf(f,"%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", (max_depth < 0 ? "full " :""), name, (unsigned long)talloc_total_size(ptr), (unsigned long)talloc_total_blocks(ptr)); return; } - fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d) %p\n", + fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d) %p\n", depth*4, "", name, (unsigned long)talloc_total_size(ptr), @@ -2047,8 +2047,8 @@ _PUBLIC_ void talloc_enable_leak_report_full(void) atexit(talloc_report_null_full); } -/* - talloc and zero memory. +/* + talloc and zero memory. */ _PUBLIC_ void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -2062,7 +2062,7 @@ _PUBLIC_ void *_talloc_zero(const void *ctx, size_t size, const char *name) } /* - memdup with a talloc. + memdup with a talloc. */ _PUBLIC_ void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name) { |