Date: Mon, 15 Sep 1997 00:23:09 -0400 (EDT) From: Tim Vanderhoek <hoek@hwcn.org> To: Mikael Karpberg <karpen@ocean.campus.luth.se> Cc: Terry Lambert <tlambert@primenet.com>, hackers@FreeBSD.ORG Subject: Re: Memory leak in getservbyXXX? Message-ID: <Pine.GSO.3.96.970915001015.2337C-100000@james.freenet.hamilton.on.ca> In-Reply-To: <199709150337.FAA01640@ocean.campus.luth.se>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Sep 1997, Mikael Karpberg wrote: > [Example showing that you should not use "static" in MT programs. Obvious.] 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. -- Outnumbered? Maybe. Outspoken? Never! tIM...HOEk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.970915001015.2337C-100000>