Commit Graph
56 Commits
Author SHA1 Message Date
Evan AlmloffandJonathan Kelley baf5a95cae Fix cloned rsx double drop (#2839)
* Implement Rc generational pointers

* Clean up error handling a bit

* start adding tests

* Simplify a few types

* Separate Rc and normal generational boxes

* Add tests for rc drop and read

* Move over the pointer instead of the data in ReadOnlySignal props

* Fix panic on ref drop and release mode builds

* final rc signal cleanup

* use rc generational boxes for event handlers as well

* add a regression test for read only signal cloning

* merge main

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-14 09:23:09 -07:00
Evan Almloff 14081e7e45 Add a warning when a copy value is used in a higher scope than it was created in (#2771) 2024-08-02 10:48:13 -07:00
Jonathan Kelley e42b71b1ba Fix #2612: adjust readable trait to allow try_peek (#2714)
* Fix #2612: adjust readable trait to allow try_peek

Our implementation for Readable was inconsistent.
We had a try_unchecked variant for read but not for peek.
This resolves that by making a breaking change to the
Readable interface.

* fix doctests too
2024-07-26 18:20:16 -05:00
Evan Almloff c7c0f4481a Fix generation race condition with sync storage (#2638)
* Fix generation race condition with sync storage

* Document GenerationalPointer

* check generation before recycling generational box

* fix clippy

* make race_condition_regression test panic if it fails
2024-07-23 10:30:57 -07:00
Rafał Krzyważnia 54dbe6d074 Use RwLock::read in SyncStorage (#2463)
Replaces `RwLock::try_read` with `RwLock::read` in `SyncStorage`. This change prioritizes potential deadlocks over panics, as unwrapping a failed `try_read` is deemed less desirable.
2024-05-30 07:05:20 -05:00
Evan Almloff 47c87568e1 Fix event handler memory leak (#2298)
* fix event handler memory leak and double drops

* Prevent double dropping generational boxes

* recycle instead of dropping
2024-04-26 00:47:22 -04:00
Jonathan Kelley 702509cb7e Fix recycling on component callbacks (#2247) 2024-04-04 16:48:06 -07:00
Jonathan Kelley 0a3291084f Use a VecDequeue instead of a vec for bytes (#2246)
* Fix: add both the rAF queue and vecdequeue

* Fix: Take before recycle
2024-04-04 16:29:28 -07:00
Jonathan KelleyandEvan Almloff 633e2a70a4 Fix memory leak in owner (#2245)
* Fix: memory leak on listeners for elements

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-04 15:32:23 -07:00
Jonathan KelleyandEvan Almloff 44fe2defc2 Fix: memory leak on listeners for elements (#2244)
* Fix: memory leak on listeners for elements
* Recycle in manuallydrop

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-04 14:25:17 -07:00
Evan Almloff 9f283f571f fix signal error message and add tests (#2118) 2024-03-20 08:45:27 -07:00
Evan Almloff 58f7efafea Make EventHandler copy (#2112)
* implement Copy for EventHandler
* implement from closure for event handler and remove special on prefix
* fix props implementation of EventHandler
2024-03-19 19:48:53 -07:00
Evan Almloff f51b5617e1 add a test for the memo hook 2024-03-11 15:33:46 -05:00
Evan Almloff 4bc2f4a713 add more docs around lifetime downcasting 2024-03-08 10:46:34 -06:00
Evan Almloff 5f9e5f607b rename take to manually drop 2024-03-08 10:35:27 -06:00
Evan Almloff 60a84956d1 restore lifetime checking for signals 2024-03-08 10:32:57 -06:00
Evan Almloff 1af8f56e89 make target an associated type 2024-02-07 08:53:21 -06:00
Evan Almloff 356497df4e fix some clippy lints 2024-02-05 08:17:25 -06:00
Evan Almloff 50e3216d8b convert T into signals automatically 2024-01-29 13:36:39 -06:00
Jonathan Kelley 9633cfadde fix gen box compile release no features 2024-01-23 15:41:37 -08:00
Evan Almloff 51d7133ca5 add readable and writable traits for signal-like structs 2024-01-23 10:05:59 -06:00
Evan Almloff 93adb35cfa fix removing debug borrow information when the ref is dropped 2024-01-23 07:41:46 -06:00
Evan Almloff 6ed5df644e fix generational box release builds 2024-01-23 07:38:29 -06:00
Evan Almloff 89b7784d31 make validate private again 2024-01-23 07:32:53 -06:00
Jonathan Kelley 079fec3be6 simplify generational box by compressing debug info 2024-01-22 21:17:02 -08:00
Evan Almloff e01f10e25d remove mappable and mappablemut traits 2024-01-22 16:51:25 -06:00
Evan Almloff a10f9496c7 don't panic in try variants even in release mode 2024-01-22 08:32:13 -06:00
Jonathan Kelley 028f499bf6 Fix generational box in release mode 2024-01-21 12:46:19 -08:00
Evan Almloff b34418fd28 fix generational box 2024-01-08 13:54:54 -06:00
ealmloff f54ee1c361 Merge branch 'master' into map-signal 2024-01-05 18:30:31 -06:00
ealmloff cde5ac5f58 fix invalid locations never being dropped (#1747) 2024-01-03 14:01:50 -06:00
Evan Almloff b7c9817cf3 fix tests 2024-01-02 15:19:01 -06:00
Evan Almloff e0ff6ce4da fix some merge changes in generational box 2023-12-17 17:42:34 -06:00
Evan Almloff f646f68b60 Merge branch 'master' into maybe-sync-signal 2023-12-15 18:38:06 -06:00
Evan Almloff 6b17d3db1e fix signals crate 2023-12-15 18:35:48 -06:00
Evan Almloff 9e388c3c51 refactor generational box into multiple files 2023-12-15 08:50:54 -06:00
Evan Almloff 70c3abb8df Merge branch 'master' into maybe-sync-signal 2023-12-14 12:29:32 -06:00
Evan Almloff c1bfe9514f document remaining items in generational box 2023-11-07 13:19:26 -06:00
Evan Almloff 2731ca0b30 fix ref try map 2023-11-07 09:26:12 -06:00
Evan Almloff 4e19f8f2be make GenerationalBoxId send and sync 2023-11-06 18:57:55 -06:00
Evan Almloff 466005890d make effect system async to make signals send + sync 2023-11-06 18:47:51 -06:00
Evan Almloff ebbaacf073 fix read and write impls 2023-11-03 10:27:21 -05:00
Evan Almloff 0a8de1d40f clean up ref mapping with GATs 2023-11-02 19:35:53 -05:00
Evan Almloff fdec47b90b fix clippy 2023-11-01 08:19:35 -05:00
Evan Almloff 8a62e4a987 Merge branch 'master' into debug-signals 2023-10-31 13:55:20 -05:00
Evan Almloff 90e04edcdf make the signal runtime global 2023-10-30 14:25:31 -05:00
Evan Almloff 4ac6aed482 try specialization 2023-10-26 16:36:41 -05:00
Evan Almloff 1126c1d329 make signal sync 2023-10-26 12:47:53 -05:00
Evan Almloff c65116c173 restore deref<Fn() -> Ref> 2023-10-16 13:03:37 -05:00
Evan Almloff 18f8daf0bd fix generational box tests 2023-08-21 15:00:31 -05:00