diff options
author | 2023-06-18 10:47:42 -0700 | |
---|---|---|
committer | 2023-06-18 10:47:42 -0700 | |
commit | fdb7940c4e435a5b7f5a368f4168d748baf6b5b6 (patch) | |
tree | ee23b0ee654cb7ff9307ccc1db961fed444e01f6 /src/bun.js/bindings/bindings.cpp | |
parent | 873f615358b78f913b3f8fe6adda47da7e6e57ac (diff) | |
download | bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.gz bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.zst bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.zip |
Fix a bunch of bugs (#3352)
* Fix a bunch of bugs
* undo that one
* Fix crash in readdir()
* woops
* woops
* Add comment
* :scissors:
* Make `readlink()` and `realpath` use much less memory
* Update BunString.cpp
* woopsie
* Unnecessary
* Don't commit these
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/bindings.cpp')
-rw-r--r-- | src/bun.js/bindings/bindings.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index e64162b34..74357f225 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -1192,6 +1192,16 @@ void WebCore__DOMURL__pathname_(WebCore__DOMURL* domURL, ZigString* arg1) *arg1 = Zig::toZigString(pathname); } +BunString WebCore__DOMURL__fileSystemPath(WebCore__DOMURL* arg0) +{ + const WTF::URL& url = arg0->href(); + if (url.isLocalFile()) { + return Bun::toString(url.fileSystemPath()); + } + + return BunStringEmpty; +} + extern "C" JSC__JSValue ZigString__toJSONObject(const ZigString* strPtr, JSC::JSGlobalObject* globalObject) { auto str = Zig::toString(*strPtr); @@ -3690,12 +3700,10 @@ JSC__JSValue JSC__VM__runGC(JSC__VM* vm, bool sync) JSC::JSLockHolder lock(vm); vm->finalizeSynchronousJSExecution(); - WTF::releaseFastMallocFreeMemory(); if (sync) { vm->heap.collectNow(JSC::Sync, JSC::CollectionScope::Full); - WTF::releaseFastMallocFreeMemory(); } else { vm->heap.collectSync(JSC::CollectionScope::Full); } |