From owner-freebsd-hackers Sun Sep 14 23:23:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA03903 for hackers-outgoing; Sun, 14 Sep 1997 23:23:13 -0700 (PDT) Received: from usr04.primenet.com (tlambert@usr04.primenet.com [206.165.6.204]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA03898 for ; Sun, 14 Sep 1997 23:23:11 -0700 (PDT) Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id XAA14978; Sun, 14 Sep 1997 23:23:04 -0700 (MST) From: Terry Lambert Message-Id: <199709150623.XAA14978@usr04.primenet.com> Subject: Re: Memory leak in getservbyXXX? To: hoek@hwcn.org Date: Mon, 15 Sep 1997 06:23:04 +0000 (GMT) Cc: karpen@ocean.campus.luth.se, tlambert@primenet.com, hackers@FreeBSD.ORG In-Reply-To: from "Tim Vanderhoek" at Sep 15, 97 00:23:09 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I think he meant, > > "wouldn't it be nice if I could do" > > signal_handler () { > ... > pcopy = not_static_copy ("string", > global_buffer_i_happen_to_keep_always_lying_around_especially_\ > for_use_in_my_signal_handlers); > ... > } > > Or maybe he meant, > > "wouldn't it be nice if I could do" > > printf ("%s%s", unstatic ("ab", buf1), unstatic ("bb", buf2)); > > Of course, if I happen to pass NULL as the buffer, then it will > use its own static buffer. That's a nice compromise, actually. The only problem is that static buffers are intrinsically sized. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.