Socket
Socket
Sign inDemoInstall

@yuuang/ffi-rs-linux-arm64-musl

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yuuang/ffi-rs-linux-arm64-musl - npm Package Compare versions

Comparing version 1.0.77 to 1.0.78

2

package.json
{
"name": "@yuuang/ffi-rs-linux-arm64-musl",
"version": "1.0.77",
"version": "1.0.78",
"os": [

@@ -5,0 +5,0 @@ "linux"

@@ -19,3 +19,3 @@ # ffi-rs

## features
## Features

@@ -51,3 +51,3 @@ - High performance ✨

## changelog
## Changelog

@@ -715,2 +715,25 @@ See [CHANGELOG.md](./CHANGELOG.md)

## Memory Management
It's important to free the memory allocations during a single ffi call prevent memory leak.
What kinds of data memory are allocated in this?
- call parameters in Rust environment which are allocated in the heap like `String`
- return value which in C environment which are allocated in the heap like `char*`
At default, `ffi-rs` will free all of memory both call parameters and return value(except functionConstructor).
In some cases, the called c function also free memory has been allocated after ffi-call will cause repeated release error.
For avoid this error, there are two ways to prevent `ffi-rs` free memory automatically
- set `freeResultMemory: false` when call `load` method
If you set freeResultMemory to false, `ffi-rs` will not release the return result memory which was allocated in c environment
- Use `DataType.External` as paramsType or retType
If developers use `DataType.External` as paramsType or retType, please use `freePointer` to release the memory of pointer when this memory is no longer in use. ref [test.ts](./test.ts#170)
## runInNewThread

@@ -717,0 +740,0 @@

Sorry, the diff of this file is not supported yet

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