c-for-go
                                
                                 c-for-go copied to clipboard
                                
                                    c-for-go copied to clipboard
                            
                            
                            
                        Avoid lock / unlock for some function call
@xlab I'm trying to compare the auto-generated code https://github.com/leslie-wang/opus-go/blob/latest-c-for-go/opus/opus.go and the manual generated one https://github.com/hraban/opus/blob/v2/encoder.go, seems like the auto generated one calls function copyPInt16Bytes twice, in which lock/unlock always happen. It means everytime calling c function will lock/unlock which is an expensive operation. Actually the earlier version https://github.com/xlab/opus-go/blob/master/opus/opus.go won't do lock/unlock either. Is there any rational behind it? Is it possible to avoid it?