Comments (2)
I can guess the context in which you're opening this issue. saghul/txiki.js#457, right? :)
The extra allocation could be avoided like this:
diff --git a/src/unix/fs.c b/src/unix/fs.c
index 3a74350f..99d42d4e 100644
--- a/src/unix/fs.c
+++ b/src/unix/fs.c
@@ -2127,6 +2127,13 @@ void uv_fs_req_cleanup(uv_fs_t* req) {
uv__free(req->bufs);
req->bufs = NULL;
+#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
+ if (req->fs_type == UV_FS_REALPATH) {
+ free(req->ptr); /* _Not_ uv__free() */
+ req->ptr = NULL;
+ }
+#endif
+
if (req->fs_type != UV_FS_OPENDIR && req->ptr != &req->statbuf)
uv__free(req->ptr);
req->ptr = NULL;
from libuv.
I can guess the context in which you're opening this issue. saghul/txiki.js#457, right? :)
Pretty much :-)
The extra allocation could be avoided like this:
Not quite. We have other uses of realpath. The one that hit me first was:
Line 804 in a7c44d6
Which can also be fixed in a similar way.
After sleeping on it it's probably ok to just go through and fix the specific instances of this problem. Having a few small allocations on the system allocator is not too bad...
from libuv.
Related Issues (20)
- test: udp_multicast_join, udp_multicast_join6 failed under loongarch64 HOT 3
- Abstract socket namespace not work for 1.48 HOT 4
- several tests ha failed HOT 4
- unix udp close crash HOT 9
- linux,udp: don't use sendmmsg for single datagrams
- bug in libuv io_uring causes incorrect event reports to epoll and busy loop HOT 14
- `-Wstringop-overread` warning with libuv v1.48.0 (`unix/tcp.c:295`) with IBM AT17.0 (GCC 13.2.1) HOT 3
- Test failure with 1.48.0 on OSX x86 HOT 10
- Bug in TCP keep-alive with unix socket
- MSVC compiler bug broke env_vars test in ASAN (x64 windows 2022+asan) HOT 4
- Additional Libuv Metrics HOT 2
- test: flaky fs_event_close_with_pending_event HOT 2
- _alloca Requested memory may have edge problems causing exceptions HOT 3
- multicast: The Android server(apk) doesn't always receive multicast messages from ubuntu.
- test,ci: flaky fs_event_error_reporting
- android: enable fdsan?
- Send udp broadcast to 255.255.255.255 cause permission denied error HOT 2
- macos: use absolute timeouts for condition variables HOT 1
- fs_event_watch_dir test fails on alpine 3.19 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libuv.