Switch vals to thread_locals

It's not possible to share them across threads, so in case we decide to use multithreading in the future, it's best to mark them as thread_local right away, even if it's a no-op right now.
This commit is contained in:
Ingvar Stepanyan
2020-07-17 16:19:02 +01:00
committed by Ingvar Stepanyan
parent f1cd6a87da
commit e342766cbf
13 changed files with 182 additions and 180 deletions

View File

@@ -11,7 +11,7 @@ int version() {
return WebPGetEncoderVersion();
}
const val Uint8Array = val::global("Uint8Array");
thread_local const val Uint8Array = val::global("Uint8Array");
val encode(std::string img, int width, int height, WebPConfig config) {
uint8_t* img_in = (uint8_t*)img.c_str();