[7654] in Athena Bugs
ditroff/troff/n3.c
daemon@ATHENA.MIT.EDU (John T Kohl)
Thu Jun 13 12:13:28 1991
Date: Thu, 13 Jun 91 12:13:13 EDT
From: John T Kohl <jtkohl@MIT.EDU>
To: bugs@MIT.EDU
It tries to allocate space which isn't aligned on word boundaries,
which can cause some indigestion on MIPS.
*** /source/third/common/ditroff/troff/n3.c Tue Mar 19 19:31:24 1991
--- n3.c Tue Jan 29 09:31:22 1991
***************
*** 517,522 ****
--- 517,525 ----
}
+ /* only works for y = powers of 2... */
+ #define roundup(x,y) (((x) + (y-1)) & ~(y-1))
+
char *setbrk(x)
int x;
{
***************
*** 523,530 ****
register char *i;
char *sbrk();
! if (x % 2 == 1)
! x++;
if ((i = sbrk(x)) == MAXPTR) {
fprintf(stderr, "troff: Core limit reached.\n");
edone(0100);
--- 526,533 ----
register char *i;
char *sbrk();
! x = roundup(x,4);
!
if ((i = sbrk(x)) == MAXPTR) {
fprintf(stderr, "troff: Core limit reached.\n");
edone(0100);