Jelajahi Sumber

Disable vector (orc causes random segfaults)

DarthSim 5 tahun lalu
induk
melakukan
f30e065a96
2 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 4 0
      vips.go
  2. 1 0
      vips.h

+ 4 - 0
vips.go

@@ -59,6 +59,10 @@ func initVips() {
 
 
 	C.vips_concurrency_set(1)
 	C.vips_concurrency_set(1)
 
 
+	// Vector calculations cause SIGSEGV sometimes when working with JPEG.
+	// It's better to disable it since profit it quite small
+	C.vips_vector_set_enabled(0)
+
 	if len(os.Getenv("IMGPROXY_VIPS_LEAK_CHECK")) > 0 {
 	if len(os.Getenv("IMGPROXY_VIPS_LEAK_CHECK")) > 0 {
 		C.vips_leak_set(C.gboolean(1))
 		C.vips_leak_set(C.gboolean(1))
 	}
 	}

+ 1 - 0
vips.h

@@ -2,6 +2,7 @@
 
 
 #include <vips/vips.h>
 #include <vips/vips.h>
 #include <vips/vips7compat.h>
 #include <vips/vips7compat.h>
+#include <vips/vector.h>
 
 
 enum ImgproxyImageTypes {
 enum ImgproxyImageTypes {
   UNKNOWN = 0,
   UNKNOWN = 0,