AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2012.09.06 15:30 "[Tiff] Managing the buffer", by
2012.09.06 17:10 "Re: [Tiff] Managing the buffer", by
2012.09.07 09:21 "Re: [Tiff] Managing the buffer", by
2012.09.07 09:57 "Re: [Tiff] Managing the buffer", by Joris Van Damme
2012.09.07 10:26 "RE: [Tiff] Managing the buffer", by
2012.09.07 11:01 "Re: [Tiff] Managing the buffer", by Joris Van Damme
2012.09.07 13:12 "RE: [Tiff] Managing the buffer", by
2012.09.07 13:39 "Re: [Tiff] Managing the buffer", by Joris Van Damme
2012.09.07 13:45 "RE: [Tiff] Managing the buffer", by
2012.09.07 14:16 "Re: [Tiff] Managing the buffer", by Bob Friesenhahn
2012.09.07 14:31 "Re: [Tiff] Managing the buffer", by
2012.09.07 15:52 "Re: [Tiff] Managing the buffer", by Bob Friesenhahn
2012.09.07 11:25 "Re: [Tiff] Managing the buffer", by

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

Hi, Joris

Robert,

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!

Tif_unix.c:

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

Tif_win32.c:

274
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?

Thanks
Robert

--
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