X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/532939df3783fc17b262c6a30b57e0b086abe4aa..b3ab6785f6871a84567168e1bd0426ff2f66d282:/malloc.c diff --git a/malloc.c b/malloc.c index bfa4cec..7234801 100644 --- a/malloc.c +++ b/malloc.c @@ -3,7 +3,9 @@ */ /* - * "'The Chamber of Records,' said Gimli. 'I guess that is where we now stand.'" + * 'The Chamber of Records,' said Gimli. 'I guess that is where we now stand.' + * + * [p.321 of _The Lord of the Rings_, II/v: "The Bridge of Khazad-Dûm"] */ /* This file contains Perl's own implementation of the malloc library. @@ -970,7 +972,7 @@ static const char bucket_of[] = static void morecore (register int bucket); # if defined(DEBUGGING) -static void botch (char *diag, char *s, char *file, int line); +static void botch (const char *diag, const char *s, const char *file, int line); # endif static void add_to_chain (void *p, MEM_SIZE size, MEM_SIZE chip); static void* get_from_chain (MEM_SIZE size); @@ -1281,7 +1283,7 @@ emergency_sbrk(MEM_SIZE size) #endif /* defined PERL_EMERGENCY_SBRK */ static void -write2(char *mess) +write2(const char *mess) { write(2, mess, strlen(mess)); } @@ -1291,13 +1293,13 @@ write2(char *mess) #define ASSERT(p,diag) if (!(p)) botch(diag,STRINGIFY(p),__FILE__,__LINE__); static void -botch(char *diag, char *s, char *file, int line) +botch(const char *diag, const char *s, const char *file, int line) { dVAR; + dTHX; if (!(PERL_MAYBE_ALIVE && PERL_GET_THX)) goto do_write; else { - dTHX; if (PerlIO_printf(PerlIO_stderr(), "assertion botched (%s?): %s %s:%d\n", diag, s, file, line) != 0) {