Commit Graph
9 Commits
Author SHA1 Message Date
Marc RousavyandGitHub 3691f5e389 fix: Fix cyclic JVM reference on CxxPart (memory leak) (#1459)
* chore: Test all allocation tests with 55k objects

* Update getTests.ts

* Update ThreadPool.cpp

* fix callback exhaust memory

* fix: Update Harness to 1.4.0-rc.1 to detect native crashes

* fix: Fix cyclic JVM reference on `CxxPart` (memory leak) (#1460)

* fix: Fix cyclic JVM reference on `CxxPart` (memory leak)

* perf: Remove C++ mutex

* Update JHybridObject.cpp

* Make it lazy

* fix: Just use a `var`

* doc

* Update HybridObject.kt
2026-07-31 16:02:57 +02:00
a4cf95da19 fix: Read _tasks.empty() under _queueMutex in ThreadPool::run() (#1413)
_tasks is a std::queue (backed by std::deque), not thread-safe.
Reading empty() outside the lock while worker threads call pop() and
run() itself calls push() is an unsynchronized access — a data race
caught by TSan. Move the check inside the existing lock scope and call
addThread() after releasing (since addThread() also takes _queueMutex).

Co-authored-by: Miklós Fazekas <boga@MBPM5P.local>
Co-authored-by: Marc Rousavy <me@mrousavy.com>
2026-06-24 16:10:04 +02:00
Marc RousavyandGitHub 7c5666ccba fix: Fix AnyMap not overwriting keys (#1204) 2026-02-04 20:21:11 +01:00
Marc RousavyandGitHub dc1fdb0ad8 chore: Add deprecation notice to JSIConverter<std::future> (#351)
* chore: Add deprecation notice to `JSIConverter<std::future>`

* Update JSIConverter+Future.hpp

* chore: Fix order of initialization
2024-11-19 12:35:20 +01:00
Marc RousavyandGitHub f94cfbcbc8 feat: Allow ThreadPool to grow dynamically (#345)
* feat: Allow `ThreadPool` to grow dynamically

* feat: Add upper limit to `ThreadPool`

* fix: Fix potential race condition when ThreadPool gets destroyed while `addThread()`
2024-11-19 00:27:27 +01:00
Marc RousavyandGitHub 8832bc5225 feat: Add new Promise<T> implementation for C++ (#343)
* feat: Create `Promise.hpp`

* feat: Add `JSIConverter+Exception`

* feat: Base for `Promise` and `Exception`

* fix: Implement Exception conversion

* Implement `Promise::awaitFuture`

* Revive `+Future`

* fix: Speed up creating `ThreadPool`

* fix: Make `+Future` also just use `+Promise` impl

* fix: Thread pool has 10 threads now.

* feat: Allow `ThreadPool` to grow dynamically

* chore: Format C++
2024-11-19 00:01:46 +01:00
Marc RousavyandGitHub e7b9f412eb fix: Rewrite Logger to use platform NSLog / __android_log_print (#54)
* fix: Fix wrong include..?

* fix: Reimplement NitroLogger as a platform-specific logger

* fix: Copy args, and use proper tag

* fix: Fix sprintf crash because of wrong format argument

* fix: Fix Logger usage on iOS
2024-08-20 16:20:44 +02:00
Marc Rousavy ee1e7c9646 fix: Make ThreadPool only two Threads big 2024-08-05 16:36:57 +02:00
Marc Rousavy 950ff037fc feat: Use efficient ThreadPool to speed up Promise creation 2024-08-05 16:32:55 +02:00