From 1da67325ceb39e74479b00ec9bd07b5937e3afc8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 8 Mar 2001 17:13:59 +0000 Subject: [PATCH] Add procedures to allocate strings without garbage collecting. --- v7/src/microcode/extern.h | 11 ++++++----- v7/src/microcode/string.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/v7/src/microcode/extern.h b/v7/src/microcode/extern.h index b987f4f1b..eeb4bedcb 100644 --- a/v7/src/microcode/extern.h +++ b/v7/src/microcode/extern.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: extern.h,v 9.58 2001/03/08 17:01:55 cph Exp $ +$Id: extern.h,v 9.59 2001/03/08 17:12:50 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -212,11 +212,12 @@ extern SCHEME_OBJECT EXFUN (make_vector, (long, SCHEME_OBJECT, Boolean)); extern SCHEME_OBJECT EXFUN (allocate_string, (unsigned long)); extern SCHEME_OBJECT EXFUN (allocate_string_no_gc, (unsigned long)); extern SCHEME_OBJECT EXFUN - (memory_to_string, (unsigned long, unsigned char *)); + (memory_to_string, (unsigned long, CONST unsigned char *)); extern SCHEME_OBJECT EXFUN - (memory_to_string_no_gc, (unsigned long, unsigned char *)); -extern SCHEME_OBJECT EXFUN (char_pointer_to_string, (unsigned char *)); -extern SCHEME_OBJECT EXFUN (char_pointer_to_string_no_gc, (unsigned char *)); + (memory_to_string_no_gc, (unsigned long, CONST unsigned char *)); +extern SCHEME_OBJECT EXFUN (char_pointer_to_string, (CONST unsigned char *)); +extern SCHEME_OBJECT EXFUN + (char_pointer_to_string_no_gc, (CONST unsigned char *)); /* Random and OS utilities */ extern Boolean EXFUN (Restore_History, (SCHEME_OBJECT)); diff --git a/v7/src/microcode/string.c b/v7/src/microcode/string.c index 6f6ac882f..0f0f1977a 100644 --- a/v7/src/microcode/string.c +++ b/v7/src/microcode/string.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: string.c,v 9.42 2001/03/08 17:02:02 cph Exp $ +$Id: string.c,v 9.43 2001/03/08 17:13:59 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -60,7 +60,7 @@ DEFUN (allocate_string_no_gc, (nbytes), unsigned long nbytes) SCHEME_OBJECT DEFUN (memory_to_string, (nbytes, data), unsigned long nbytes AND - unsigned char * data) + CONST unsigned char * data) { SCHEME_OBJECT result = (allocate_string (nbytes)); unsigned char * scan_result = (STRING_LOC (result, 0)); @@ -73,7 +73,7 @@ DEFUN (memory_to_string, (nbytes, data), SCHEME_OBJECT DEFUN (memory_to_string_no_gc, (nbytes, data), unsigned long nbytes AND - unsigned char * data) + CONST unsigned char * data) { SCHEME_OBJECT result = (allocate_string_no_gc (nbytes)); unsigned char * scan_result = (STRING_LOC (result, 0)); @@ -84,7 +84,8 @@ DEFUN (memory_to_string_no_gc, (nbytes, data), } SCHEME_OBJECT -DEFUN (char_pointer_to_string, (char_pointer), unsigned char * char_pointer) +DEFUN (char_pointer_to_string, (char_pointer), + CONST unsigned char * char_pointer) { unsigned char * scan = char_pointer; if (scan == 0) @@ -97,7 +98,7 @@ DEFUN (char_pointer_to_string, (char_pointer), unsigned char * char_pointer) SCHEME_OBJECT DEFUN (char_pointer_to_string_no_gc, (char_pointer), - unsigned char * char_pointer) + CONST unsigned char * char_pointer) { unsigned char * scan = char_pointer; if (scan == 0) -- 2.25.1