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)
- If you attempt to send a UDP packet to an IPv4 address using an IPv6 socket, sendto() will report the WSAEFAULT error. HOT 10
- Missing symbols in the library file compared to the headers HOT 4
- Issue with GetSystemTimePreciseAsFileTime on Windows Server 2008 in libuv 1.48.0 and Suggested Fix HOT 1
- CMake build fails with FetchContent HOT 2
- the child process (forked from parent process which use libuv) crash with abort() called HOT 4
- UV_UDP_LINUX_RECVERR make loop busy HOT 1
- How can I use libuv raw socket in windows? HOT 1
- The uv__run_idle and uv__run_prepare stages of event loop are unclear HOT 3
- unix: uv_udp_open invalid HOT 3
- I'm going to assume this has been answered but let me know if there's reason to reopen. HOT 13
- new cygwin-induced compatibility bug HOT 1
- New release? HOT 44
- aix: fs_* tests are failing HOT 2
- ibmi: fs_* test are failing HOT 1
- Potential buffer overflow in uv_pipe_chmod() HOT 2
- win: `uv_available_parallelism` doesn't respect process affinity HOT 4
- win: new `uv_available_parallelism` returns double the expected threads in 32-bit applications HOT 1
- fs_utime_round fails on bcachefs HOT 6
- Miner
- fs: preadv failing on armv7 HOT 22
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.