diff options
author | Damjan Marion <damarion@cisco.com> | 2020-09-11 22:13:46 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2020-09-14 14:04:06 +0200 |
commit | b509504e6b6eb8590d2d7dad2447c1bd933ce94c (patch) | |
tree | f8f307985be5ea96d4bd908638903919358eb370 /src/vppinfra/pmalloc.c | |
parent | 999395cd6644a297c01dd6de033cf1ffb4e9951b (diff) |
vppinfra: add clib_log2_page_sz and format/unformat functions
Type: improvement
Change-Id: Ie44dbf9396cfed19dba153810b7bd76ce5377cd4
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/pmalloc.c')
-rw-r--r-- | src/vppinfra/pmalloc.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index e0f3f3a6585..870f3647229 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -584,24 +584,6 @@ clib_pmalloc_free (clib_pmalloc_main_t * pm, void *va) } static u8 * -format_log2_page_size (u8 * s, va_list * va) -{ - u32 log2_page_sz = va_arg (*va, u32); - - if (log2_page_sz >= 30) - return format (s, "%uGB", 1 << (log2_page_sz - 30)); - - if (log2_page_sz >= 20) - return format (s, "%uMB", 1 << (log2_page_sz - 20)); - - if (log2_page_sz >= 10) - return format (s, "%uKB", 1 << (log2_page_sz - 10)); - - return format (s, "%uB", 1 << log2_page_sz); -} - - -static u8 * format_pmalloc_page (u8 * s, va_list * va) { clib_pmalloc_page_t *pp = va_arg (*va, clib_pmalloc_page_t *); |