diff options
author | Thomas Haller <thaller@redhat.com> | 2020-09-28 14:50:01 +0200 |
---|---|---|
committer | Antonio Cardace <acardace@redhat.com> | 2020-09-28 16:07:52 +0200 |
commit | 740b092fda3d5f45102422f22884c88ea6c42858 (patch) | |
tree | 5a049cc10c99efb5ee39606b8b1d0893a9f46db3 /shared/nm-std-aux/nm-std-utils.c | |
parent | 328fb90f3e0d4e35975aff63944ac0412d7893a5 (diff) | |
download | NetworkManager-ac/clang-format.tar.gz |
format: replace tabs for indentation in code commentsac/clang-format
sed -i \
-e 's/^'$'\t'' \*/ */g' \
-e 's/^'$'\t\t'' \*/ */g' \
-e 's/^'$'\t\t\t'' \*/ */g' \
-e 's/^'$'\t\t\t\t'' \*/ */g' \
-e 's/^'$'\t\t\t\t\t'' \*/ */g' \
-e 's/^'$'\t\t\t\t\t\t'' \*/ */g' \
-e 's/^'$'\t\t\t\t\t\t\t'' \*/ */g' \
$(git ls-files -- '*.[hc]')
Diffstat (limited to 'shared/nm-std-aux/nm-std-utils.c')
-rw-r--r-- | shared/nm-std-aux/nm-std-utils.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/shared/nm-std-aux/nm-std-utils.c b/shared/nm-std-aux/nm-std-utils.c index 606692a7b8..b2060e135b 100644 --- a/shared/nm-std-aux/nm-std-utils.c +++ b/shared/nm-std-aux/nm-std-utils.c @@ -17,8 +17,8 @@ nm_utils_get_next_realloc_size(bool true_realloc, size_t requested) if (requested <= 40) { /* small allocations. Increase in small steps of 8 bytes. - * - * We get thus sizes of 8, 16, 32, 40. */ + * + * We get thus sizes of 8, 16, 32, 40. */ if (requested <= 8) return 8; if (requested <= 16) @@ -27,27 +27,27 @@ nm_utils_get_next_realloc_size(bool true_realloc, size_t requested) return 32; /* The return values for < 104 are essentially hard-coded, and the choice here is - * made without very strong reasons. - * - * We want to stay 24 bytes below the power-of-two border 64. Hence, return 40 here. - * However, the next step then is already 104 (128 - 24). It's a larger gap than in - * the steps before. - * - * It's not clear whether some of the steps should be adjusted (or how exactly). */ + * made without very strong reasons. + * + * We want to stay 24 bytes below the power-of-two border 64. Hence, return 40 here. + * However, the next step then is already 104 (128 - 24). It's a larger gap than in + * the steps before. + * + * It's not clear whether some of the steps should be adjusted (or how exactly). */ return 40; } if (requested <= 0x2000u - 24u || NM_UNLIKELY(!true_realloc)) { /* mid sized allocations. Return next power of two, minus 24 bytes extra space - * at the beginning. - * That means, we double the size as we grow. - * - * With !true_realloc, it means that the caller does not intend to call - * realloc() but instead clone the buffer. This is for example the case, when we - * want to nm_explicit_bzero() the old buffer. In that case we really want to grow - * the buffer exponentially every time and not increment in page sizes of 4K (below). - * - * We get thus sizes of 104, 232, 488, 1000, 2024, 4072, 8168... */ + * at the beginning. + * That means, we double the size as we grow. + * + * With !true_realloc, it means that the caller does not intend to call + * realloc() but instead clone the buffer. This is for example the case, when we + * want to nm_explicit_bzero() the old buffer. In that case we really want to grow + * the buffer exponentially every time and not increment in page sizes of 4K (below). + * + * We get thus sizes of 104, 232, 488, 1000, 2024, 4072, 8168... */ if (NM_UNLIKELY(requested > SIZE_MAX / 2u - 24u)) return SIZE_MAX; @@ -67,8 +67,8 @@ nm_utils_get_next_realloc_size(bool true_realloc, size_t requested) return SIZE_MAX; /* For large allocations (with !true_realloc) we allocate memory in chunks of - * 4K (- 24 bytes extra), assuming that the memory gets mmapped and thus - * realloc() is efficient by just reordering pages. */ + * 4K (- 24 bytes extra), assuming that the memory gets mmapped and thus + * realloc() is efficient by just reordering pages. */ n = ((requested + (0x0FFFu + 24u)) & ~((size_t) 0x0FFFu)) - 24u; nm_assert(n >= requested); return n; |