@yuuang/ffi-rs-linux-arm64-musl
Advanced tools
Comparing version 1.0.37 to 1.0.38
{ | ||
"name": "@yuuang/ffi-rs-linux-arm64-musl", | ||
"version": "1.0.37", | ||
"version": "1.0.38", | ||
"os": [ | ||
@@ -5,0 +5,0 @@ "linux" |
@@ -16,2 +16,9 @@ # ffi-rs | ||
## features | ||
- High performance | ||
- Simpler data describe and api interface | ||
- Support more data type between `Node.js` and `c type` | ||
- Support modify data in place | ||
## benchmark | ||
@@ -58,3 +65,3 @@ | ||
- [pointer](#pointer) | ||
- [u8Array](#array) | ||
- [u8Array](#buffer)(buffer) | ||
- [i32Array](#array) | ||
@@ -191,2 +198,28 @@ - [stringArray](#array) | ||
### Buffer | ||
In the lateset version, `ffi-rs` support modify data in place. | ||
The sample code is as follows | ||
```c | ||
extern int modifyData(char* buffer) { | ||
// modify buffer data in place | ||
} | ||
``` | ||
```js | ||
const arr = Buffer.alloc(200) // create buffer | ||
const res = load({ | ||
library: "libsum", | ||
funcName: "modifyData", | ||
retType: DataType.I32, | ||
paramsType: [ | ||
DataType.U8Array | ||
], | ||
paramsValue: [arr] | ||
}) | ||
console.log(arr) // buffer data can be updated | ||
``` | ||
### Array | ||
@@ -393,3 +426,3 @@ | ||
byte: 66, | ||
byteArray: [103, 104], | ||
byteArray: Buffer.from([103, 104]), | ||
}; | ||
@@ -408,3 +441,3 @@ const person = { | ||
byte: 65, | ||
byteArray: [101, 102], | ||
byteArray: Buffer.from([101, 102]), | ||
}; | ||
@@ -411,0 +444,0 @@ const parentType = { |
Sorry, the diff of this file is not supported yet
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
615
608685