node-ffi-rs
Advanced tools
Comparing version 1.0.79 to 1.0.80
@@ -92,3 +92,3 @@ | ||
needFree?: boolean | ||
// whether or not free function call params memory automatically which are allocated in c side | ||
// Default:false, whether or not free function call params memory automatically which are allocated in c side | ||
freeCFuncParamsMemory?: boolean | ||
@@ -174,3 +174,3 @@ }; | ||
runInNewThread?: RunInNewThread | ||
// whether or not need to free the result of return value memory automatically, default is true | ||
// Default:false, whether or not need to free the result of return value memory automatically | ||
freeResultMemory?: boolean | ||
@@ -177,0 +177,0 @@ } |
@@ -349,3 +349,3 @@ const { existsSync, readFileSync } = require('fs') | ||
if (params.freeResultMemory === undefined) { | ||
params.freeResultMemory = true | ||
params.freeResultMemory = false | ||
} | ||
@@ -364,3 +364,3 @@ return load(processParamsTypeForArray(params)) | ||
needFree: false, | ||
freeCFuncParamsMemory: true, | ||
freeCFuncParamsMemory: false, | ||
...options, | ||
@@ -367,0 +367,0 @@ }) |
{ | ||
"name": "node-ffi-rs", | ||
"version": "1.0.79", | ||
"version": "1.0.80", | ||
"main": "index.js", | ||
@@ -62,12 +62,12 @@ "types": "index.d.ts", | ||
"optionalDependencies": { | ||
"@yuuang/ffi-rs-darwin-arm64": "1.0.79", | ||
"@yuuang/ffi-rs-darwin-x64": "1.0.79", | ||
"@yuuang/ffi-rs-linux-arm64-gnu": "1.0.79", | ||
"@yuuang/ffi-rs-linux-arm64-musl": "1.0.79", | ||
"@yuuang/ffi-rs-linux-x64-gnu": "1.0.79", | ||
"@yuuang/ffi-rs-linux-x64-musl": "1.0.79", | ||
"@yuuang/ffi-rs-win32-arm64-msvc": "1.0.79", | ||
"@yuuang/ffi-rs-win32-ia32-msvc": "1.0.79", | ||
"@yuuang/ffi-rs-win32-x64-msvc": "1.0.79" | ||
"@yuuang/ffi-rs-darwin-arm64": "1.0.80", | ||
"@yuuang/ffi-rs-darwin-x64": "1.0.80", | ||
"@yuuang/ffi-rs-linux-arm64-gnu": "1.0.80", | ||
"@yuuang/ffi-rs-linux-arm64-musl": "1.0.80", | ||
"@yuuang/ffi-rs-linux-x64-gnu": "1.0.80", | ||
"@yuuang/ffi-rs-linux-x64-musl": "1.0.80", | ||
"@yuuang/ffi-rs-win32-arm64-msvc": "1.0.80", | ||
"@yuuang/ffi-rs-win32-ia32-msvc": "1.0.80", | ||
"@yuuang/ffi-rs-win32-x64-msvc": "1.0.80" | ||
} | ||
} |
@@ -723,9 +723,9 @@ # ffi-rs | ||
At default, `ffi-rs` will free all of memory both call parameters and return value(except functionConstructor). | ||
At default, `ffi-rs` will free call parameters memory which are allocated in Rust. | ||
In some cases, the called c function also free memory has been allocated after ffi-call will cause repeated release error. | ||
But not free the return value from c side since some c dynamic library will manage their memory automatically(when ffi-rs >= 1.0.79) | ||
For avoid this error, there are two ways to prevent `ffi-rs` free memory automatically | ||
There are two ways to prevent `ffi-rs` release memory | ||
- set `freeResultMemory: false` when call `load` method | ||
- set `freeResultMemory: false` when call `load` method, the default value is false | ||
@@ -732,0 +732,0 @@ If you set freeResultMemory to false, `ffi-rs` will not release the return result memory which was allocated in c environment |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39921