no longer need to clean up main buffers

thread-private buffers are now only on workers, no need to to start them
up or free them on the main thread
This commit is contained in:
John Cupitt 2016-10-19 09:58:13 +01:00
parent 75dee18848
commit 1a915db678
3 changed files with 4 additions and 17 deletions

View File

@ -133,7 +133,6 @@ int vips_mapfilerw( VipsImage * );
int vips_remapfilerw( VipsImage * );
void vips__buffer_init( void );
void vips__buffer_shutdown( void );
void vips__copy_4byte( int swap, unsigned char *to, unsigned char *from );
void vips__copy_2byte( gboolean swap, unsigned char *to, unsigned char *from );

View File

@ -652,7 +652,7 @@ buffer_thread_destroy_notify( VipsBufferThread *buffer_thread )
buffer_thread_free( buffer_thread );
}
/* Init the buffer cache system.
/* Init the buffer cache system. This must only be called from worker threads.
*/
void
vips__buffer_init( void )
@ -671,6 +671,9 @@ vips__buffer_init( void )
if( buffer_cache_max_reserve < 1 )
printf( "vips__buffer_init: buffer reserve disabled\n" );
if( !vips_thread_isworker() )
printf( "vips__buffer_init: called for non-worker\n" );
#ifdef DEBUG
printf( "vips__buffer_init: DEBUG enabled\n" );
#endif /*DEBUG*/
@ -680,13 +683,3 @@ vips__buffer_init( void )
#endif /*DEBUG_CREATE*/
}
void
vips__buffer_shutdown( void )
{
VipsBufferThread *buffer_thread;
if( (buffer_thread = g_private_get( buffer_thread_key )) ) {
buffer_thread_free( buffer_thread );
g_private_set( buffer_thread_key, NULL );
}
}

View File

@ -400,10 +400,6 @@ vips_init( const char *argv0 )
vips_error_clear();
}
/* Start up the buffer cache.
*/
vips__buffer_init();
/* Get the run-time compiler going.
*/
vips_vector_init();
@ -512,7 +508,6 @@ vips_leak( void )
void
vips_thread_shutdown( void )
{
vips__buffer_shutdown();
vips__thread_profile_detach();
}