Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ffi-rs

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ffi-rs - npm Package Compare versions

Comparing version 1.0.79 to 1.0.80

4

index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc