Bug 689625 - Memory management work
Summary: Memory management work
Status: RESOLVED FIXED
Alias: None
Product: jbig2dec
Classification: Unclassified
Component: Missing Feature (show other bugs)
Version: master
Hardware: PC Windows NT
: P4 enhancement
Assignee: Shailesh Mistry
URL:
Keywords:
: 694560 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-22 01:18 UTC by Ken Sharp
Modified: 2023-05-24 15:59 UTC (History)
6 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Sharp 2007-12-22 01:18:11 UTC
Need to rework the memory allocator so that we can use GS memory management
rather than the system malloc.

Assigned it to Ralph for now, but it may well be reassigned to me.
Comment 1 leonardo 2007-12-23 00:09:38 UTC
Please explain better what do you mean here. I changed assignment to myself 
because I'm the ownwer of the memory management.
Comment 2 Ralph Giles 2007-12-23 00:30:18 UTC
What is desired is to modify sjbig2.c and sjbig2_luratech.c so that the library
uses the ghostscript allocator through callbacks rather than system malloc() as
is currently implemented. 

The changes also seem to require some modifications to the allocator callbacks
in the jbig2dec which don't currently include a user data pointer. This isn't an
issue with the luratech library.

This bug has nothing to do with the memory manager itself.
Comment 3 leonardo 2007-12-23 23:45:50 UTC
I'm still unclear what has to be done here because I don't see memory namager 
calls in sjbig2.c . Please make the report to be understandable for the staff. 
Please change the bug title to reflect the problem. Passing to Ralph who says 
it's a jbig2 bridge proiblem, and jbig2.dev is owned by Ralph.
Comment 4 Ken Sharp 2007-12-24 04:07:04 UTC
The bug title doesn't mention the memory manager, it mentions memory management
work. The work does relate to memory management, the problem at the moment is
that the code is using the system malloc, not the Ghostscript memory manager.

It would obviously be preferable to use the Ghostscript memory manger
(potentially even vital on some embedded systems). I looked into this, because
Ralph mentioned that it should already be possible to use the GS memory manager.
Unfortunately I found that the memory allocator in jbig2dec was incompatible
with the GS memory manager routines. 

In order to make the two compatible, some kind of glue (or bridge if you prefer)
is required.

So at the moment the jbig2dec memory management is incorrect because it is not
using the GS memory manager. Work is needed on the management of memory in the
jbig2dec product in order to use the correct memory manager. The work is on the
management of memory in jbig2dec, not the memory manager.

Does this make the situation clear ?

Comment 5 leonardo 2007-12-24 08:34:30 UTC
Yes it is. Thank you.
Comment 6 Shailesh Mistry 2011-07-26 17:15:48 UTC
Enhancement still missing in Ghostscript 9.03
Comment 7 Henry Stiles 2012-09-26 17:56:01 UTC
Assigning to Alex who is currently doing a similar project with the Luratech component.
Comment 8 Ken Sharp 2013-06-12 08:15:24 UTC
Assigning to henry as the owner of decoders. Henry the 'problem' is outlined in comment #4, that jbig2dec doesn't use the Ghostscript memory manager. I have no idea if the Luratech equivalent was done, I assume it was.
Comment 9 Chris Liddell (chrisl) 2013-09-03 12:21:05 UTC
*** Bug 694560 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Rasmussen 2023-05-24 15:59:47 UTC
I just had a check in ghostpdl's source code and the jbig2dec interface has been extended by me to accommodate a custom allocator and base/sjbig2.c has been updated to provide a glue layer to the ghostscript memory allocator.

Based on that this appear to be fixed, I close this bug.