From 5a911c6263debfd1a6466839bfa2865553049180 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Mon, 19 Oct 1998 09:08:40 +0000 Subject: [PATCH] Implement a hook to allow us to reclaim the memory used by the first stage of the bootstrap (the bit which loads /boot/loader). --- lib/libstand/stand.h | 5 ++++- lib/libstand/zalloc_malloc.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 4199fd672e46..251e7e8de124 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: stand.h,v 1.6 1998/09/26 10:48:50 dfr Exp $ + * $Id: stand.h,v 1.7 1998/10/06 19:23:57 msmith Exp $ * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ */ @@ -181,6 +181,9 @@ extern void *calloc(size_t n1, size_t n2); extern void *realloc(void *ptr, size_t size); extern void *reallocf(void *ptr, size_t size); extern void mallocstats(void); +#ifdef __alpha__ +extern void free_region(void *start, void *end); +#endif /* disklabel support (undocumented, may be junk) */ struct disklabel; diff --git a/lib/libstand/zalloc_malloc.c b/lib/libstand/zalloc_malloc.c index 6cb4953ef312..d70a8f7577c0 100644 --- a/lib/libstand/zalloc_malloc.c +++ b/lib/libstand/zalloc_malloc.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: zalloc_malloc.c,v 1.2 1998/09/26 10:48:50 dfr Exp $ + * $Id: zalloc_malloc.c,v 1.3 1998/10/01 17:35:08 msmith Exp $ */ /* @@ -49,6 +49,15 @@ void mallocstats(void); #undef free #endif +#ifdef __alpha__ +void +free_region(void *start, void *end) +{ + zextendPool(&MallocPool, start, (caddr_t)end - (caddr_t)start); + zfree(&MallocPool, start, (caddr_t)end - (caddr_t)start); +} +#endif + void * malloc(size_t bytes) {