🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by J.T. Conklin Mon, 16 Nov 1992 23:24
memory leak in gnu make 3.62
#1102
Author: J.T. Conklin
Date: Mon, 16 Nov 1992 23:24
27 lines
1572 bytes
The following patch allocates storage on the stack in the DIRONLY
macro, rather than using the savestring function().  The macro is
a tiny bit uglier, but it doesn't waste memory.

Performance should not suffer since good compilers will recognize that
"(p - (s))" is a common subexpression.

diff -c make/commands.c:1.1.1.1 make/commands.c:1.3
*** make/commands.c:1.1.1.1	Mon Nov 16 15:12:56 1992
--- make/commands.c	Mon Nov 16 15:12:56 1992
***************
*** 65,71 ****
  #define	LASTSLASH(s)	rindex ((s), '/')
  #define	FILEONLY(s)	(p != 0 ? p + 1 : (s))
  #define	DIRONLY(s)	(p == 0 ? "./" : p == (s) ? "/" \
! 			 : savestring ((s), (p - (s)) + 1))
  
    /* $* is the stem from an implicit or static pattern rule.  */
    if (file->stem == 0)
--- 65,71 ----
  #define	LASTSLASH(s)	rindex ((s), '/')
  #define	FILEONLY(s)	(p != 0 ? p + 1 : (s))
  #define	DIRONLY(s)	(p == 0 ? "./" : p == (s) ? "/" \
! 			 : strncpy(alloca((p - (s)) + 1), s, (p - (s))))
  
    /* $* is the stem from an implicit or static pattern rule.  */
    if (file->stem == 0)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads