But you have done that already
And Lonny is almost finished converting his modules, so once they are available, you could drop instead the LDG module support.
With your help
Actually, zView LDG modules are working pretty nicely except for memory consumption I would agree but this can be mitigated a lot by implementing a smart module loader.
With zView SLB plugin design, it pushes back the plugin dependencies complexity to the application side, which I really don't like. I know there are not so many candidates for implementing zView SLB plugin support
but if you add complexity here, that's not good advertising
in zView at least, the png library was used 3 times at least, zlib 4 times at least, and jpeg 2 times. If you look at the size of SLBs (which don't even have mintlib linked), that means ~900K of memory&code wasted. If you run the original zView, you will see that it takes almost 8MB of memory, even without any images opened yet (and that is with just the codecs provided by zview, not counting any extra ones). That has been dropped to ~1.5MB with the current version. So we are talking about several MB here, not just a few KB. IMHO that was way too much, even for "high-end" Ataris.
8MB because all modules are loaded
When zView is up, no module should be loaded. Unbeatable
BTW, just noted that Vision takes about 1.2MB when started and that includes all internal image modules like TIFF, JPEG, TGA, GIF (much more limited of course than open source libs) and classic Atari formats plus all editing/catalog/filter stuff. You sure that you can't improve memory consumption more in zView (see attached top command)?
There is a conceptual problem when linking any c-library into the modules. Any resources allocated (memory, open files etc) are done on behalf of the application that uses it, but maintained statically in the modules. So the application has no way of freeing these resources when unloading the modules.
Each module has/should have a terminate function called by the app to free all allocated stuff when module is about to get unloaded. Anyway if a module does not free its own stuff, SLB model does not help here.
Agreed, we have talked about that already. But it is not as easy as one may think, especially the condition whether a library in still in use.
? Right after an image is loaded, call the image module memory manager to unload the most unused modules.
I tried an extreme test with Vision: unload a zvLDG after an image is loaded, created a catalog of more than 1000 files with 100 LDGs, no problem.
Unfortunately that assumption is wrong. Almost all libraries have some logging mechanism, and that is mostly using printf style functions.
As mentioned by Cypran, just define printf to void in this case as a printf would be ugly anyway. Here is the main interest for the app to provide a printf-like logging function.
Don' get me wrong, I'd be happy to implement a modern plugin model in Vision, my point is that the current SLB one is not mature enough to me; I've spent a lot of time in Vision to remove this kind of dependencies regarding GUI/image module/plugins and I'm not ready to break this...
You do not have the required permissions to view the files attached to this post.