diff --git a/Cargo.toml b/Cargo.toml index 85f27f1..dd96bdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,10 @@ edition = "2021" [features] +static = ["cl3/static"] +dynamic = ["cl3/dynamic"] + +# CL_VERSION_1_0 = ["cl3/CL_VERSION_1_0"] CL_VERSION_1_1 = ["cl3/CL_VERSION_1_1"] CL_VERSION_1_2 = ["cl3/CL_VERSION_1_2"] CL_VERSION_2_0 = ["cl3/CL_VERSION_2_0"] @@ -65,11 +69,13 @@ cl_pocl_content_size = ["cl3/cl_pocl_content_size"] cl_loader_layers = ["cl3/cl_loader_layers"] # Default features: -default = ["CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] +default = ["static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] +# default = ["dynamic"] [dependencies] libc = "0.2" -cl3 = "0.10" +# cl3 = "0.10" +cl3 = { git = "https://github.com/kenba/cl3", branch = "develop" } serde = { version = "1.0", optional = true } [dev-dependencies] diff --git a/src/svm.rs b/src/svm.rs index f2428b2..88bf72e 100644 --- a/src/svm.rs +++ b/src/svm.rs @@ -151,7 +151,7 @@ impl<'a, T> SvmRawVec<'a, T> { alloc::dealloc(self.ptr.cast::(), layout); } } else { - unsafe { svm_free(self.context.get(), self.ptr.cast::()) }; + unsafe { let _ = svm_free(self.context.get(), self.ptr.cast::()); }; } } @@ -175,7 +175,7 @@ impl<'a, T> Drop for SvmRawVec<'a, T> { alloc::dealloc(self.ptr.cast::(), layout); } } else { - unsafe { svm_free(self.context.get(), self.ptr.cast::()) }; + unsafe { let _ = svm_free(self.context.get(), self.ptr.cast::()); }; } self.ptr = ptr::null_mut(); }