From: Matthew Fernandez Date: Sun, 5 Jul 2020 23:48:19 +0000 (-0700) Subject: remove unused vmstat API X-Git-Tag: 2.46.0~20^2^2~193^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f033c490e2499bfa9b0cf7f2374165000c02d23c;p=graphviz remove unused vmstat API --- diff --git a/lib/vmalloc/CMakeLists.txt b/lib/vmalloc/CMakeLists.txt index 1fd463f49..3f3956013 100644 --- a/lib/vmalloc/CMakeLists.txt +++ b/lib/vmalloc/CMakeLists.txt @@ -12,7 +12,6 @@ add_library(vmalloc STATIC vmdcheap.c vmopen.c vmprivate.c - vmstat.c vmstrdup.c vmwalk.c ) diff --git a/lib/vmalloc/Makefile.am b/lib/vmalloc/Makefile.am index 056500f63..662b56be7 100644 --- a/lib/vmalloc/Makefile.am +++ b/lib/vmalloc/Makefile.am @@ -6,7 +6,7 @@ noinst_LTLIBRARIES = libvmalloc_C.la libvmalloc_C_la_SOURCES = vmbest.c vmclear.c vmclose.c vmdcheap.c \ vmopen.c vmprivate.c \ - vmstat.c vmstrdup.c \ + vmstrdup.c \ vmwalk.c EXTRA_DIST = README vmalloc.vcxproj* diff --git a/lib/vmalloc/vmalloc.h b/lib/vmalloc/vmalloc.h index 181494a96..25977f0ea 100644 --- a/lib/vmalloc/vmalloc.h +++ b/lib/vmalloc/vmalloc.h @@ -122,8 +122,6 @@ extern "C" { extern int vmprofile(Vmalloc_t *, int); - extern int vmstat(Vmalloc_t *, Vmstat_t *); - extern int vmwalk(Vmalloc_t *, int (*)(Vmalloc_t *, void *, size_t, Vmdisc_t *)); diff --git a/lib/vmalloc/vmalloc.vcxproj b/lib/vmalloc/vmalloc.vcxproj index 3371f531b..4cc0839bb 100644 --- a/lib/vmalloc/vmalloc.vcxproj +++ b/lib/vmalloc/vmalloc.vcxproj @@ -102,7 +102,6 @@ - diff --git a/lib/vmalloc/vmalloc.vcxproj.filters b/lib/vmalloc/vmalloc.vcxproj.filters index 8692a8a67..abe067236 100644 --- a/lib/vmalloc/vmalloc.vcxproj.filters +++ b/lib/vmalloc/vmalloc.vcxproj.filters @@ -41,9 +41,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/vmalloc/vmstat.c b/lib/vmalloc/vmstat.c deleted file mode 100644 index 6f68d22d7..000000000 --- a/lib/vmalloc/vmstat.c +++ /dev/null @@ -1,106 +0,0 @@ -/* $Id$ $Revision$ */ -/* vim:set shiftwidth=4 ts=8: */ - -/************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: See CVS logs. Details at http://www.graphviz.org/ - *************************************************************************/ - -#include "vmhdr.h" - -/* Get statistics from a region. -** -** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94. -*/ - -int vmstat(Vmalloc_t * vm, Vmstat_t * st) -{ - reg Seg_t *seg; - reg Block_t *b, *endb; - reg size_t s = 0; - reg Vmdata_t *vd = vm->data; - - if (!st) - return -1; - if (!(vd->mode & VM_TRUST)) { - if (ISLOCK(vd, 0)) - return -1; - SETLOCK(vd, 0); - } - - st->n_busy = st->n_free = 0; - st->s_busy = st->s_free = st->m_busy = st->m_free = 0; - st->n_seg = 0; - st->extent = 0; - - if (vd->mode & VM_MTLAST) - st->n_busy = 0; - else if ((vd->mode & VM_MTPOOL) && (s = vd->pool) > 0) { - s = ROUND(s, ALIGN); - for (b = vd->free; b; b = SEGLINK(b)) - st->n_free += 1; - } - - for (seg = vd->seg; seg; seg = seg->next) { - st->n_seg += 1; - st->extent += seg->extent; - - b = SEGBLOCK(seg); - endb = BLOCK(seg->baddr); - - if (vd->mode & (VM_MTDEBUG | VM_MTBEST | VM_MTPROFILE)) { - while (b < endb) { - s = SIZE(b) & ~BITS; - if (ISJUNK(SIZE(b)) || !ISBUSY(SIZE(b))) { - if (s > st->m_free) - st->m_free = s; - st->s_free += s; - st->n_free += 1; - } else { /* get the real size */ - if (vd->mode & VM_MTDEBUG) - s = DBSIZE(DB2DEBUG(DATA(b))); - else if (vd->mode & VM_MTPROFILE) - s = PFSIZE(DATA(b)); - if (s > st->m_busy) - st->m_busy = s; - st->s_busy += s; - st->n_busy += 1; - } - - b = (Block_t *) ((Vmuchar_t *) DATA(b) + - (SIZE(b) & ~BITS)); - } - } else if (vd->mode & VM_MTLAST) { - if ((s = - seg->free ? (SIZE(seg->free) + sizeof(Head_t)) : 0) > 0) { - st->s_free += s; - st->n_free += 1; - } - if ((s = ((char *) endb - (char *) b) - s) > 0) { - st->s_busy += s; - st->n_busy += 1; - } - } else if ((vd->mode & VM_MTPOOL) && s > 0) { - if (seg->free) - st->n_free += (SIZE(seg->free) + sizeof(Head_t)) / s; - st->n_busy += - ((seg->baddr - (Vmuchar_t *) b) - sizeof(Head_t)) / s; - } - } - - if ((vd->mode & VM_MTPOOL) && s > 0) { - st->n_busy -= st->n_free; - if (st->n_busy > 0) - st->s_busy = (st->m_busy = vd->pool) * st->n_busy; - if (st->n_free > 0) - st->s_free = (st->m_free = vd->pool) * st->n_free; - } - - CLRLOCK(vd, 0); - return 0; -}