gbranden pushed a commit to branch master in repository groff. commit 4f319f4db376aea27c98f0d1011cf2d548b3dd65 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Fri Aug 27 11:21:00 2021 +1000
[libgroff]: Drop long-dead `COOKIE_BUG` logic. * src/libs/libgroff/new.cpp (operator new, operator delete): Drop preprocessor conditional branches on the `COOKIE_BUG` symbol. This was de-documented, and an autoconf check for its necessity removed, way back in groff 1.10 (November 1995). It was relevant only to GCC from versions 2.0 to 2.2.2 (all 1992). --- ChangeLog | 10 ++++++++++ src/libs/libgroff/new.cpp | 19 ------------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d6f551..4575971 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2021-08-27 G. Branden Robinson <g.branden.robin...@gmail.com> + + [libgroff]: Drop long-dead `COOKIE_BUG` logic. + + * src/libs/libgroff/new.cpp (operator new, operator delete): + Drop preprocessor conditional branches on the `COOKIE_BUG` + symbol. This was de-documented, and an autoconf check for its + necessity removed, way back in groff 1.10 (November 1995). It + was relevant only to GCC from versions 2.0 to 2.2.2 (all 1992). + 2021-08-24 G. Branden Robinson <g.branden.robin...@gmail.com> [libgroff]: Refactor `font::scan_papersize()`. diff --git a/src/libs/libgroff/new.cpp b/src/libs/libgroff/new.cpp index 2826389..4c6d1b8 100644 --- a/src/libs/libgroff/new.cpp +++ b/src/libs/libgroff/new.cpp @@ -36,11 +36,7 @@ void *operator new(size_t size) // Avoid relying on the behaviour of malloc(0). if (size == 0) size++; -#ifdef COOKIE_BUG - char *p = (char *)malloc(unsigned(size + 8)); -#else /* not COOKIE_BUG */ char *p = (char *)malloc(unsigned(size)); -#endif /* not COOKIE_BUG */ if (p == 0) { if (program_name) { ewrite(program_name); @@ -49,23 +45,13 @@ void *operator new(size_t size) ewrite("out of memory\n"); _exit(-1); } -#ifdef COOKIE_BUG - ((unsigned *)p)[1] = 0; - return p + 8; -#else /* not COOKIE_BUG */ return p; -#endif /* not COOKIE_BUG */ } void operator delete(void *p) { -#ifdef COOKIE_BUG - if (p) - free((void *)((char *)p - 8)); -#else if (p) free(p); -#endif /* COOKIE_BUG */ } void operator delete(void *p, @@ -78,11 +64,6 @@ void operator delete(void *p, // In function 'void operator delete(void*, long unsigned int)': // warning: deleting 'void*' is undefined [-Wdelete-incomplete] //delete p; -#ifdef COOKIE_BUG - if (p) - free((void *)((char *)p - 8)); -#else if (p) free(p); -#endif /* COOKIE_BUG */ } _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit