From 4555cc43a0ef0a277a8b527fd8289a0bef36d50c Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Wed, 20 May 2020 12:56:52 +0200 Subject: [PATCH] detach array buffer on read free as a test --- fuse-native.c | 4 ++-- index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fuse-native.c b/fuse-native.c index ad72dfd..64bc00f 100644 --- a/fuse-native.c +++ b/fuse-native.c @@ -366,7 +366,7 @@ FUSE_METHOD_VOID(releasedir, 2, 0, (const char *path, struct fuse_file_info *inf } }) -FUSE_METHOD(read, 6, 1, (const char *path, char *buf, size_t len, off_t offset, struct fuse_file_info *info), { +FUSE_METHOD(read, 6, 2, (const char *path, char *buf, size_t len, off_t offset, struct fuse_file_info *info), { l->path = path; l->buf = buf; l->len = len; @@ -380,7 +380,7 @@ FUSE_METHOD(read, 6, 1, (const char *path, char *buf, size_t len, off_t offset, napi_create_uint32(env, l->len, &(argv[5])); FUSE_UINT64_TO_INTS_ARGV(l->offset, 6) }, { - // TODO: handle bytes processed? + napi_detach_arraybuffer(env, argv[3]); }) FUSE_METHOD(write, 6, 1, (const char *path, const char *buf, size_t len, off_t offset, struct fuse_file_info *info), { diff --git a/index.js b/index.js index d7484d6..8e162ca 100644 --- a/index.js +++ b/index.js @@ -458,7 +458,7 @@ class Fuse extends Nanoresource { _op_read (signal, path, fd, buf, len, offsetLow, offsetHigh) { this.ops.read(path, fd, buf, len, getDoubleArg(offsetLow, offsetHigh), (err, bytesRead) => { - return signal(err, bytesRead) + return signal(err, bytesRead, buf) }) }