]> granicus.if.org Git - graphviz/commitdiff
remove unused vmstat API
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 5 Jul 2020 23:48:19 +0000 (16:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 6 Jul 2020 00:15:35 +0000 (17:15 -0700)
lib/vmalloc/CMakeLists.txt
lib/vmalloc/Makefile.am
lib/vmalloc/vmalloc.h
lib/vmalloc/vmalloc.vcxproj
lib/vmalloc/vmalloc.vcxproj.filters
lib/vmalloc/vmstat.c [deleted file]

index 1fd463f49de9aa10392290e310850a9fc86de6c0..3f39560134efdfe301dc8bbeb0452d419d759d2e 100644 (file)
@@ -12,7 +12,6 @@ add_library(vmalloc STATIC
     vmdcheap.c
     vmopen.c
     vmprivate.c
-    vmstat.c
     vmstrdup.c
     vmwalk.c
 )
index 056500f63370ce225b23cb00a0dd6d275b8f1dde..662b56be7b9a33cf9f278450a2dd3fff6e389d69 100644 (file)
@@ -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*
index 181494a967f66e48240caa7ea98dec2228c06d3c..25977f0eac8729f7025730f9b763ca4217b0a656 100644 (file)
@@ -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 *));
index 3371f531b1430327a8eb8a646a01c7abb10ae418..4cc0839bb0f658b5a2e599b9835944377ce02696 100644 (file)
     <ClCompile Include="vmdcheap.c" />
     <ClCompile Include="vmopen.c" />
     <ClCompile Include="vmprivate.c" />
-    <ClCompile Include="vmstat.c" />
     <ClCompile Include="vmstrdup.c" />
     <ClCompile Include="vmwalk.c" />
   </ItemGroup>
index 8692a8a67a01b452308cf40319340513decd142b..abe0672360fe2531a3371d9a1620ce84357ab8fb 100644 (file)
@@ -41,9 +41,6 @@
     <ClCompile Include="vmprivate.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="vmstat.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="vmstrdup.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/vmalloc/vmstat.c b/lib/vmalloc/vmstat.c
deleted file mode 100644 (file)
index 6f68d22..0000000
+++ /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;
-}