Gary Guo

Results 147 comments of Gary Guo

The trait suggested here isn't actually implementable: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=23e3e48fbc2816cf3f6460bceeba6dd2 Probably it should have an extra lifetime param: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=23e3e48fbc2816cf3f6460bceeba6dd2 ```rust pub trait FieldProjecting

I experimented the field pointer idea before, and I find it not satisfactory because there are no way to distinguish two fields of the same type in the same struct...

I have no immediate clue of what's wrong there. Maybe try deleting files in /tmp and try again as WSL doesn't clean up the temporary files automatically.

I did a few experiments, and I think I got an idea that can reduce `async_std::sync::Mutex` to the size of usize and makes it allocation-free when there isn't contention. Here's...

The linked list nodes are allocated on the heap, for the benefits of a stable address. Linked list has an extra benefit of guaranteed `O(1)` insertion/removal (slab uses `Vec`, which...

> If you just use [futures_intrusive::sync::Mutex](https://docs.rs/futures-intrusive/0.2.0/futures_intrusive/sync/type.Mutex.html) you get your parking-lot backed small mutex without any need for heap allocations - and even without the need to write the code yourself...

> Btw: I would be super careful with pure Spinlocks in userspace. If the OS schedules away the thread which holds the lock you will start wasting a ton of...

> Yes, it's literally a [HUGE amount of dependencies](https://github.com/Matthias247/futures-intrusive/blob/master/Cargo.toml#L21-L22) 😀 If you see #252 you will notice that parking-lot is explicitly removed as a dependency from this project.

Could you squash the commits?