2012.09.06 15:30 "[Tiff] Managing the buffer", by

2012.09.07 13:12 "RE: [Tiff] Managing the buffer", by

Hi, Joris


But I still don't quite see how to do that, is there a routine pass the client allocation routine (in the way you pass file routines to TIFFClientOpen?) I don't see this in the man page you reference.

It's been many years since I fooled around with this, so I really can't remember exactly... But I think LibTiff maintains some global pointers to the allocation routines and such, and you can simply set these pointers to point

> to your own instead. Take a good look at the implementation of these routines

I don't see how to do it without altering the code of libtiff, as far as I can tell _TIFFMalloc just calls malloc() (on unix) and I suppose that, at compile time, the build system uses a different allocation routine depending upon the platform it's on. It would be better for me not to use TIFF than to require having a special 'hacked' version of libtiff!


238 void*
239 _TIFFmalloc(tsize_t s)
240 {
241 return (malloc((size_t) s));
242 }


275 tdata_t
276 _TIFFmalloc(tsize_t s)
277 {
278 return ((tdata_t)GlobalAlloc(GMEM_FIXED, s));
279 }

Or am I not understanding something even more clever?


This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom