[OpenAFS-devel] Re: [patch] darwin libresolv needs res_init() to adapt to network changes

Adam Megacz megacz@cs.berkeley.edu
Tue, 26 Dec 2006 14:17:30 -0800


Jeffrey Altman <jaltman@secure-endpoints.com> writes:
> Will calling res_init() multiple times leak resources on MacOS/Darwin?

I don't think so.  I scanned the code for res_init() and nothing
appears to allocate any sort of resources:

  http://darwinsource.opendarwin.org/10.4.2/Libinfo-221/dns.subproj/res_init.c

A test of a tight loop ("while(1){res_init();}") shows no growth in
memory consumption and no errors/crashes/etc.

> Is there a cleanup function that should be called first?

No.

  - a

-- 
PGP/GPG: 5C9F F366 C9CF 2145 E770  B1B8 EFB1 462D A146 C380