summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-10-16 18:23:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-10-16 18:23:27 +0000
commitc9cecb379c93c29167ac1ab1153c775429d00d4b (patch)
tree9fecfc41aa9d4ed48f2b0906baa50e1122e281ad
parent8ec3479fe0d84e2e04b3e35eb30791095937443e (diff)
Kill the alloc command, which tried to measure behaviour based on sbrk.
Discussed with guenther.
-rw-r--r--bin/csh/alloc.c27
-rw-r--r--bin/csh/csh.115
-rw-r--r--bin/csh/extern.h3
-rw-r--r--bin/csh/init.c3
4 files changed, 5 insertions, 43 deletions
diff --git a/bin/csh/alloc.c b/bin/csh/alloc.c
index 92f65780408..8b16a2ab51e 100644
--- a/bin/csh/alloc.c
+++ b/bin/csh/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.10 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: alloc.c,v 1.11 2014/10/16 18:23:26 deraadt Exp $ */
/* $NetBSD: alloc.c,v 1.6 1995/03/21 09:02:23 cgd Exp $ */
/*-
@@ -38,16 +38,11 @@
#include "csh.h"
#include "extern.h"
-char *memtop = NULL; /* PWP: top of current memory */
-char *membot = NULL; /* PWP: bottom of allocatable memory */
-
ptr_t
Malloc(size_t n)
{
ptr_t ptr;
- if (membot == NULL)
- memtop = membot = sbrk(0);
if ((ptr = malloc(n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
@@ -60,8 +55,6 @@ Realloc(ptr_t p, size_t n)
{
ptr_t ptr;
- if (membot == NULL)
- memtop = membot = sbrk(0);
if ((ptr = realloc(p, n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
@@ -74,8 +67,6 @@ Calloc(size_t s, size_t n)
{
ptr_t ptr;
- if (membot == NULL)
- memtop = membot = sbrk(0);
if ((ptr = calloc(s, n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
@@ -90,19 +81,3 @@ Free(ptr_t p)
if (p)
free(p);
}
-
-/*
- * mstats - print out statistics about malloc
- *
- * Prints two lines of numbers, one showing the length of the free list
- * for each size category, the second showing the number of mallocs -
- * frees for each size category.
- */
-void
-/*ARGSUSED*/
-showall(Char **v, struct command *t)
-{
- memtop = (char *) sbrk(0);
- (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%d).\n",
- (unsigned long) membot, (unsigned long) memtop, (int)(memtop - membot));
-}
diff --git a/bin/csh/csh.1 b/bin/csh/csh.1
index aaf5e9b5bd3..a40b8be3412 100644
--- a/bin/csh/csh.1
+++ b/bin/csh/csh.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: csh.1,v 1.70 2014/01/21 03:15:44 schwarze Exp $
+.\" $OpenBSD: csh.1,v 1.71 2014/10/16 18:23:26 deraadt Exp $
.\" $NetBSD: csh.1,v 1.10 1995/03/21 09:02:35 cgd Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
.\"
-.Dd $Mdocdate: January 21 2014 $
+.Dd $Mdocdate: October 16 2014 $
.Dt CSH 1
.Os
.Sh NAME
@@ -1522,17 +1522,6 @@ is not allowed to be
or
.Dq unalias .
.Pp
-.It Ic alloc
-Shows the amount of dynamic memory acquired, broken down into used and
-free memory.
-With an argument shows the number of free and used blocks in each size
-category.
-The categories start at size 8 and double at each step.
-This command's output may vary across system types, since
-systems other than the
-.Tn VAX
-may use a different memory allocator.
-.Pp
.It Ic bg
.It Ic bg \&% Ns Ar job ...
Puts the current or specified jobs into the background, continuing them
diff --git a/bin/csh/extern.h b/bin/csh/extern.h
index abc3bd70710..45b214ae23c 100644
--- a/bin/csh/extern.h
+++ b/bin/csh/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.16 2012/12/04 02:24:46 deraadt Exp $ */
+/* $OpenBSD: extern.h,v 1.17 2014/10/16 18:23:26 deraadt Exp $ */
/* $NetBSD: extern.h,v 1.8 1996/10/31 23:50:54 christos Exp $ */
/*-
@@ -298,7 +298,6 @@ void Free(ptr_t);
ptr_t Malloc(size_t);
ptr_t Realloc(ptr_t, size_t);
ptr_t Calloc(size_t, size_t);
-void showall(Char **, struct command *);
/*
* str.c:
diff --git a/bin/csh/init.c b/bin/csh/init.c
index ddc447a37c0..364eddc76a5 100644
--- a/bin/csh/init.c
+++ b/bin/csh/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.7 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: init.c,v 1.8 2014/10/16 18:23:26 deraadt Exp $ */
/* $NetBSD: init.c,v 1.6 1995/03/21 09:03:05 cgd Exp $ */
/*-
@@ -41,7 +41,6 @@ struct biltins bfunc[] =
{
{ "@", dolet, 0, INF },
{ "alias", doalias, 0, INF },
- { "alloc", showall, 0, 1 },
{ "bg", dobg, 0, INF },
{ "break", dobreak, 0, 0 },
{ "breaksw", doswbrk, 0, 0 },