Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 1995 10:21:53 -0700
From:      Bill Paul <wpaul>
To:        CVS-commiters, cvs-gnu
Subject:   cvs commit: src/gnu/usr.sbin/ypserv server.c
Message-ID:  <199509241721.KAA06142@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
wpaul       95/09/24 10:21:53

  Modified:    gnu/usr.sbin/ypserv  server.c
  Log:
  phkmalloc strikes!
  
  #ifdef out a number of calls to free() left over from the original
  GNU ypserv implementation. As near as I can tell, the Berkeley DB
  package does its own garbage collection, hence the caller doesn't
  have to worry about free()ing the memory returned in the DBT
  structures during lookups (I'm still not 1005 sure about this:
  the DB code is very hard to follow. I must use dynamically
  allocated memory since you can retreive arbitrarily large records
  from a database, but I'm not sure where it ends up letting go
  of it). This was not true with GDBM; you had
  to do your own garbage collection.
  
  The general rule is that if you allocate memory inside an RPC
  service routine, you have to free() it the next time the routine is
  called since the underlying XDR routines won't do it for you.
  But if the DB package does this itself, then we don't need to do
  it in the main program.
  
  Note that with the original malloc(), there were never any errors
  flagged. phkmalloc complained quite loudly.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509241721.KAA06142>