[Yazlist] The Yaz Odr module and memory management

Mike Taylor mike at indexdata.com
Wed Sep 17 11:47:27 CEST 2008


Mads Bondo Dydensborg writes:
 > Hi there
 > 
 > I am in the process of writing a more friendly C++ interface to the
 > Yaz Odr module. Reading through the manual, at
 > http://www.indexdata.dk/yaz/doc/odr.use.tkl
 > I have a question about this statement:
 > 
 > You can't use the normal free(2) routine to free memory allocated
 > by this function, and ODR doesn't provide a parallel
 > function. Instead, you can call
 >      void odr_reset(ODR o, int size);
 > when you are done with the memory: Everything allocated since the
 > last call to odr_reset() is released. The odr_reset() call is also
 > required to clear up an error condition on a stream
 > 
 > Two questions:
 > 
 > 1) Whats the size paramenter for? (I reckon it is an error, it is
 > not present in the .h files of yaz 3.0.34 at least)

You are correct -- there is no size paramenter, and the documentation
has a typo.  I've fixed this in the master source, and the fix will be
included in the next release.  Thanks for spotting it.

 > 2) I reckon, it is only memory allocated on that particular stream
 > that is freed, correct? (The doc states this for some of the other
 > calls, but not this).

Yes!  :-)

 _/|_	 ___________________________________________________________________
/o ) \/  Mike Taylor    <mike at indexdata.com>    http://www.miketaylor.org.uk
)_v__/\  "May the best man win.  That'll be me of course" -- Harvey
	 Thompson.




More information about the Yazlist mailing list