trick comm byteswap functions can't handle sizes above 65536 bytes

sigh, I forgot to actually set the pthread specific data.

refs #187
This commit is contained in:
Alex Lin 2016-04-19 09:16:42 -05:00
parent 2cf25b9825
commit 8633facc86
2 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ int tc_read_byteswap(TCDevice * device, char *buffer, int size, ATTRIBUTES * att
if (( swap_buffer = pthread_getspecific(key)) == NULL ) {
swap_buffer = malloc(sizeof(struct SwapBuffer)) ;
swap_buffer->size = 0 ;
pthread_setspecific(key, swap_buffer) ;
}
if ( (unsigned int)size > swap_buffer->size ) {
unsigned int new_size = (unsigned int)size ;

View File

@ -33,6 +33,7 @@ int tc_write_byteswap(TCDevice * device, char *buffer, int size, ATTRIBUTES * at
if (( swap_buffer = pthread_getspecific(key)) == NULL ) {
swap_buffer = malloc(sizeof(struct SwapBuffer)) ;
swap_buffer->size = 0 ;
pthread_setspecific(key, swap_buffer) ;
}
if ( (unsigned int)size > swap_buffer->size ) {
unsigned int new_size = (unsigned int)size ;