ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
780 stars 132 forks source link

liq_aligned_malloc could be replaced by aligned_alloc from stdlib #42

Closed zonyitoo closed 3 years ago

zonyitoo commented 3 years ago

https://github.com/ImageOptim/libimagequant/blob/197d141e37f7944f3a5a431a1ef828c3217f2661/libimagequant.c#L461-L481

Since this library could be compiled with c11, aligned_malloc should be available.

-std=gnu11 has already become default since GCC 5: https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Standards.html

kornelski commented 3 years ago

I've tried using C99 features when they were merely 15 years old, and this caused me a lot of headaches. Even recently I've got bug reports about bad outputs caused by GCC 4, so people still use it. At this rate I'd rather not try using any C11 features before at least 2026 ;)

And as usual, MSVC does its own thing and has _aligned_malloc with an underscore.