* Add `vips_semaphore_down_timeout` to public API
In preparation for the next commit.
* threadset: stop idle threads after a regular timeout
In line with the previous behaviour of GLib's threadpool.
* threadset: fix a small memory leak
* threadset: ensure idle threads are freed on exit
GLib threads are spawned with `ref_count == 2`, this reference is
decreased during thread exit and associated resources are freed
during `g_thread_join()`. However, idle threads that are stopped
after a regular timeout are not joined. To fix this, decrease the
reference count during `vips_threadset_add()` and increase it just
before joining the thread with `g_thread_join()`.
See:
2d5d990c6a/glib/gthread.c (L522)2d5d990c6a/glib/gthread-posix.c (L1287)
* Deprecate `vips_g_thread_join()` in favor of `g_thread_join()`
* nit: remove extra semicolon
arrayjoin was making a region on every input image during startup, and
repeating for each thread (!!) so large arrays could be very expensive
to join.
Instead, make input regions on demand, and computre set of required
input images rather than searching for them.
See https://github.com/libvips/libvips/discussions/3247
In 8.13 we deprecated target_finish() (it did not have an error return)
to target_end() (now has an error return).
This PR makes target_end() also emit the "finish" signal for
compatibility with the previous API. ruby-vips, for example, looks for
on_finish() to close files.
See https://github.com/libvips/ruby-vips/issues/351
Thanks lucaskanashiro
* nsgifload: avoid minimise after mapping
Not reliable on Windows.
* nsgifload: prefer use of `VIPS_FREEF` macro
* Improve `test_descriptors.c`
* Only build `test_descriptors` when targeting Linux
* add simple bash completion support
* add "completions" subdir to meson
* start extending completion to extra args
* file complete for every arg after 1
* add completion for enums, file, ints, doubles
* docs, try to improve directory completion
though dir completion is not working correctly, I'm not sure why
* reimplement threadpool
just a set of threads that get recycled
"ninja test" passes and dzsave seems to work, though pytest fails for
some reason
* clean up threading code a bit
move base stuff into thread.c, so we have a simple
thread -> threadset -> threadpool
layering
* start trying to revert g_threadpool
based on the original commit
* working!
nice low systime again
still need to repply cnages to threadpool.c since 80e0cc3d1
* reapply fixes from master
so threadpool.c is now up to date
* rename VipsThread as VipsWorker
a bit less confusing
* use a semaphore to count workers in a pool
* tidy up
* formatting
* dynamic threadpool sizing
based on counting the number of blocked threads in each pool
it works, but the improvement is not great :(
* add "concurrency" metadata item
so operators can hint threadpool size (dzsave especially)
* don't use thinstrip for small images
* add RGB mode to openslide
since flatten was taking 20% of CPU time for dzsave
* fix up rgb mode
now actually works
* make the tile buffer per thread
in the new openslideload rgb mode
* fix dynamic pool downsize
* mild refactoring
* fix the buffer system
oops, turned it off by mistake
* all done!
* revise changelog
* Update libvips/iofuncs/threadset.c
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
* Update libvips/iofuncs/threadset.c
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
* LSan: add libMagickCore to suppression file
* Revert "Remove mutex lock for VipsThreadStartFn"
This reverts commit 41440491.
* add VIPS_MAX_THREADS
to set a hard limit on the threadset size
* Revert "Revert "Remove mutex lock for VipsThreadStartFn""
This reverts commit 77e8520966ba79194fff3b4e648bbd295cd5c260.
* remove sslock from sink.c
* move fixed threadpool build to init
not first use
* add some doc comments
* revert test suite threshold change
* add a test for MAX_THREADS
and move the test tmp/ area into the builddir
* limit VIPS_MAX_THREADS to sane values
* use tabs rather than spaces
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
* reducev: initialize the sum with the addition
Avoids an Orc opcode.
* convi: initialize the sum with the addition
Avoids an Orc opcode.
* vector: add comments to magic numbers
We were minimising at the end of threadpool_run, but this was being
called for each sinkscreen render pass, so we were throwing away the
display cache.
Instead, minimise after sink, sink_memory and sink_disc.
* Remove `glib-mkenums` autotools templates and generated files
Meson uses the `enumtypes.c.in` and `enumtypes.h.in` in
`libvips/include/vips` and doesn't use the pre-generated
files.
* Remove man files for no longer existing tools
+ update the `meson.build`.
* Remove Autotools section in `.gitignore`
* Remove `po/messages` left-over
* Remove `g-ir-scanner` entry point
No longer needed by Meson.
* Remove `glib-genmarshal` generated files
Meson doesn't use these pre-generated files.
* Remove Autotools specific Git attributes
* Remove no longer existing tools in `.gitignore`
* Remove Make specific things in `.gitignore`
* Rename COPYING to LICENSE
* Remove no longer needed `.gitignore` sections
Meson only supports out-of-tree builds. This assumes that the
build directory is ignored.
* Remove no longer needed `.editorconfig` sections
* Avoid writing the full path in enumtypes.h
Helps reproducible builds, as build paths can vary between builds.
* Use g_intern_static_string() for enum/flags type names
We are emitting a static string, so use that shortcut function to
intern it, which will save one allocation.
* Use g_once_init_enter/leave to register enum/flags type names
This is the more modern way, and ensures thread-safety.
1. Convert MULTIBAND uint/short/etc. as we convert uint8 images. They
are probably just uint8 that have been cast up in format.
2. Don't check that the image interpretation is a supported colourspace
before calling vips_colourspace() ... we want to fail with an error
if it can't be converted, not silently accept the image.
- Remove `HAVE_LCMS` definition in favor of `HAVE_LCMS2`.
- Remove `HAVE_WINDOWS_H` definition in favor of `G_OS_WIN32`.
- Remove stray `vips_text_get_type` in `conversion.c`.
- Remove duplicated `unistd.h` include.
- Remove redundant `strcasecmp` definition, we use `g_ascii_strcasecmp` everywhere.
- Remove unnecessary header checks in `configure.ac` and `meson.build`.
- Ensure `unistd.h` include is guarded with `HAVE_UNISTD_H`.
- Fail early when `-Dfontconfig=enabled` and `pangoft2` is not found.
Use the bitwise OR assignment operator to ensure that derived
classes does not overwrite the flags from the base class. Also,
move the flags from `openslideload_source` to its base class.
* compiles, but untested
* works, but libtiff needs seek for write
next: add seek methods to target
* add target seek and read
seem to work
next: disc temps for disc output
* add libnsgif COPYING
oops, we were missing the COPYING file
see https://github.com/libvips/libvips/issues/2800
thanks mika-fischer
* tiffsave uses a disc temp if it can
* revise temp target rules
only make a disc temp if we are writing to a filesystem target
* add new target methods to targetcustom
since finish did not return an error code
also make sure we don't call target_end from inside _dispose, since that
can't signal error either
see https://github.com/libvips/libvips/issues/2801
* quick proposal
warn on startup if untrusted operations might run
use vips_block_untrusted_set() to block untrusted operations, set an env
var or make a file to stop the warning
* mark fits, nifti and svg as untrusted
* remove the annoying "untrusted" warning message
better to warn on the download page
leave vips_block_untrusted_set() since it's obviously useful
* separate UNTRUSTED and BLOCKED
* typos
* add VIPS_BLOCK_UNTRUSTED env var
* move BLOCK_UNTRUSTED after plugin load
obviously, ooops
* add a test, disable *magick
although *magick is fuzzed, it's probably safer to disable it in
untrusted environments
* mark some more operations as untrusted