more tiny buffer fixups
This commit is contained in:
parent
463d2e885f
commit
cf98b92dbf
13
TODO
13
TODO
@ -1,18 +1,5 @@
|
||||
- try valgrind sharp again on desktop
|
||||
|
||||
- add some stuff to count main thread buffers being created and destroyed,
|
||||
verify that we are now handling that
|
||||
|
||||
- vips_sink_disc() calls wbuffer_position() which will set up the first
|
||||
buffer ... but that's called from the main thread and so will create a
|
||||
global buffer
|
||||
|
||||
can we call this from a worker instead and save a few locks?
|
||||
|
||||
- vips_region_dispose() calls vips_buffer_unref() which calls
|
||||
buffer_cache_get(), which will create a main-thread buffercache ... can we
|
||||
fix this?
|
||||
|
||||
- do we need all the locks?
|
||||
|
||||
- benchmark again and confirm we've not slowed down
|
||||
|
@ -477,8 +477,11 @@ vips_buffer_unref( VipsBuffer *buffer )
|
||||
buffer->ref_count -= 1;
|
||||
|
||||
if( buffer->ref_count == 0 ) {
|
||||
VipsImage *im = buffer->im;
|
||||
VipsBufferCache *cache = buffer_cache_get( im );
|
||||
/* We are not always the creating thread, for example if we
|
||||
* come here during vips_region_dispose(). cache may have been
|
||||
* NULLed out during thread exit.
|
||||
*/
|
||||
VipsBufferCache *cache = buffer->cache;
|
||||
|
||||
#ifdef DEBUG_VERBOSE
|
||||
if( !buffer->done )
|
||||
@ -489,7 +492,8 @@ vips_buffer_unref( VipsBuffer *buffer )
|
||||
|
||||
/* Place on this thread's reserve list for reuse.
|
||||
*/
|
||||
if( cache->n_reserve < buffer_cache_max_reserve ) {
|
||||
if( cache &&
|
||||
cache->n_reserve < buffer_cache_max_reserve ) {
|
||||
g_assert( !buffer->cache );
|
||||
|
||||
cache->reserve =
|
||||
|
Loading…
Reference in New Issue
Block a user