Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
1
Versions
92
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.44 to 1.0.45

2

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

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

@@ -86,2 +86,4 @@ # ffi-rs

View [test.ts](./test.ts) get the latest usage
Here is an example of how to use ffi-rs:

@@ -324,2 +326,43 @@

#### CreatePointer
```js
let bigDoubleArr = new Array(5).fill(1.1);
deepStrictEqual(
bigDoubleArr,
load({
library: "libsum",
funcName: "createArrayDouble",
retType: arrayConstructor({
type: DataType.DoubleArray,
length: bigDoubleArr.length,
}),
paramsType: [DataType.DoubleArray, DataType.I32],
paramsValue: [bigDoubleArr, bigDoubleArr.length],
}),
);
```
For the code above, we can use `createExternal` function to wrap a pointer data and send it as paramsValue
```js
const funcExternal: unknown[] = createExternal({
paramsType: [DataType.DoubleArray],
paramsValue: [[1.1,2.2]]
})
const ptr = funcExternal[0]
load({
library: "libsum",
funcName: "createArrayDouble",
retType: arrayConstructor({
type: DataType.DoubleArray,
length: bigDoubleArr.length,
}),
paramsType: [DataType.External, DataType.I32],
paramsValue: [ptr, bigDoubleArr.length],
})
```
The two pieces of code above are equivalent
### Struct

@@ -326,0 +369,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