blurhash icon indicating copy to clipboard operation
blurhash copied to clipboard

C: Thread safety and improved MSVC build support

Open rcombs opened this issue 5 years ago • 2 comments

This is derived from #72, but with the commits restructured and simplified, and some additional changes.

  • Fix building on MSVC
    • Fix incorrect static array size
    • Remove implicit type conversions
    • Remove VLA usage
  • Expose a thread-safe version of the main hash function

The original main hash function is now implemented in terms of the thread-safe version.

rcombs avatar Jul 10 '20 00:07 rcombs

Does this come with a performance cost?

mrousavy avatar Aug 04 '20 10:08 mrousavy

A small one, but yes; you could alternately solve the same problem by making the array [9][9][3] at no cost.

rcombs avatar Aug 04 '20 17:08 rcombs