wellington / go-libsass

Go wrapper for libsass, the only Sass 3.5 compiler for Go
http://godoc.org/github.com/wellington/go-libsass
Apache License 2.0
206 stars 28 forks source link

Remove extra indirection in SafeMap and callbacks. #74

Closed QuLogic closed 5 years ago

QuLogic commented 5 years ago

Sass doesn't actually care that the cookie is a real pointer, so just cast the number to a uintptr_t (which casts freely to a void*) and avoid the extra pointer and map.

Surprisingly, this fixes #73. I can only assume there is some race in creating the extra map, but I don't know for sure, as it doesn't manifest on other systems or with -race detection.