"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "node.c" between
gawk-5.0.1.tar.xz and gawk-5.1.0.tar.xz

About: GNU awk - pattern scanning and processing language.

node.c  (gawk-5.0.1.tar.xz):node.c  (gawk-5.1.0.tar.xz)
/* /*
* node.c -- routines for node management * node.c -- routines for node management
*/ */
/* /*
* Copyright (C) 1986, 1988, 1989, 1991-2001, 2003-2015, 2017, 2018, * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003-2015, 2017, 2018, 2019,
* the Free Software Foundation, Inc. * the Free Software Foundation, Inc.
* *
* This file is part of GAWK, the GNU implementation of the * This file is part of GAWK, the GNU implementation of the
* AWK Programming Language. * AWK Programming Language.
* *
* GAWK is free software; you can redistribute it and/or modify * GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
skipping to change at line 551 skipping to change at line 551
int count; int count;
int j; int j;
const char *start; const char *start;
if (do_lint_old) { if (do_lint_old) {
switch (c) { switch (c) {
case 'a': case 'a':
case 'b': case 'b':
case 'f': case 'f':
case 'r': case 'r':
warning(_("old awk does not support the `\\%c' escape seq uence"), c); lintwarn(_("old awk does not support the `\\%c' escape se quence"), c);
break; break;
} }
} }
switch (c) { switch (c) {
case 'a': case 'a':
return '\a'; return '\a';
case 'b': case 'b':
return '\b'; return '\b';
case 'f': case 'f':
skipping to change at line 1025 skipping to change at line 1025
int i; int i;
for (i = 0; i < 255; i++) { for (i = 0; i < 255; i++) {
btowc_cache[i] = btowc(i); btowc_cache[i] = btowc(i);
} }
} }
#define BLOCKCHUNK 100 #define BLOCKCHUNK 100
struct block_header nextfree[BLOCK_MAX] = { struct block_header nextfree[BLOCK_MAX] = {
{ NULL, sizeof(NODE) }, { NULL, sizeof(NODE), "node" },
{ NULL, sizeof(BUCKET) }, { NULL, sizeof(BUCKET), "bucket" },
#ifdef HAVE_MPFR #ifdef HAVE_MPFR
{ NULL, sizeof(mpfr_t) }, { NULL, sizeof(mpfr_t), "mpfr" },
{ NULL, sizeof(mpz_t) }, { NULL, sizeof(mpz_t), "mpz" },
#endif #endif
}; };
#ifdef MEMDEBUG
void *
r_getblock(int id)
{
void *res;
emalloc(res, void *, nextfree[id].size, "getblock");
nextfree[id].active++;
if (nextfree[id].highwater < nextfree[id].active)
nextfree[id].highwater = nextfree[id].active;
return res;
}
void
r_freeblock(void *p, int id)
{
nextfree[id].active--;
free(p);
}
#else
/* more_blocks --- get more blocks of memory and add to the free list; /* more_blocks --- get more blocks of memory and add to the free list;
size of a block must be >= sizeof(struct block_item) size of a block must be >= sizeof(struct block_item)
*/ */
void * void *
more_blocks(int id) more_blocks(int id)
{ {
struct block_item *freep, *np, *next; struct block_item *freep, *np, *next;
char *p, *endp; char *p, *endp;
size_t size; size_t size;
skipping to change at line 1060 skipping to change at line 1082
for (np = freep; ; np = next) { for (np = freep; ; np = next) {
next = (struct block_item *) (p += size); next = (struct block_item *) (p += size);
if (p >= endp) { if (p >= endp) {
np->freep = NULL; np->freep = NULL;
break; break;
} }
np->freep = next; np->freep = next;
} }
nextfree[id].freep = freep->freep; nextfree[id].freep = freep->freep;
nextfree[id].highwater += BLOCKCHUNK;
return freep; return freep;
} }
#endif
 End of changes. 7 change blocks. 
6 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)