From: Chris Hanson Date: Tue, 23 Apr 1996 20:58:45 +0000 (+0000) Subject: Add error-checking OS-dependent procedures for allocating and X-Git-Tag: 20090517-FFI~5603 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3854657ba3bc904427a37e88dd47ca0e6068a47f;p=mit-scheme.git Add error-checking OS-dependent procedures for allocating and deallocating memory. --- diff --git a/v7/src/microcode/ux.c b/v7/src/microcode/ux.c index 1c88ee415..839851d2c 100644 --- a/v7/src/microcode/ux.c +++ b/v7/src/microcode/ux.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: ux.c,v 1.13 1993/11/22 22:34:39 cph Exp $ +$Id: ux.c,v 1.14 1996/04/23 20:58:45 cph Exp $ -Copyright (c) 1990-1993 Massachusetts Institute of Technology +Copyright (c) 1990-96 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -617,3 +617,27 @@ DEFUN (fpathconf, (filedes, parameter), int filedes AND int parameter) } #endif /* EMULATE_FPATHCONF */ + +void * +DEFUN (OS_malloc, (size), unsigned int size) +{ + void * result = (UX_malloc (size)); + if (result == 0) + error_system_call (ENOMEM, syscall_malloc); + return (result); +} + +void * +DEFUN (OS_realloc, (ptr, size), void * ptr AND unsigned int size) +{ + void * result = (UX_realloc (ptr, size)); + if (result == 0) + error_system_call (ENOMEM, syscall_realloc); + return (result); +} + +void +DEFUN (OS_free, (ptr), void * ptr) +{ + UX_free (ptr); +}