10:05:14 @ikeji@ostatus.ikeji.ma
icon

@jmuk タイパ!

10:12:31 @ikeji@ostatus.ikeji.ma
icon

hackernewsの記事がタイムラインに流れなくなったぞ

10:13:43 @ikeji@ostatus.ikeji.ma
icon

そもそも、weakrefってどうやって実装されてるんだろう?

10:27:31 @ikeji@ostatus.ikeji.ma
icon

やっぱり、ウイークポインタ自体は、リファレンスカウントするしかないよね。

10:34:20 @ikeji@ostatus.ikeji.ma
icon

C++のweak_ptrは典型的にはshared_ptrと実装が混ざってるのかな。shared_ptrの側から見たらカウンタ一個分大きくなりそう?

https://en.cppreference.com/w/cpp/memory/weak_ptr
Like std::shared_ptr, a typical implementation of weak_ptr stores two pointers:
a pointer to the control block; and
the stored pointer of the shared_ptr it was constructed from.
A separate stored pointer is necessary to ensure that converting a shared_ptr to weak_ptr and then back works correctly, even for aliased shared_ptrs. It is not possible to access the stored pointer in a weak_ptr without locking it into a shared_ptr.

コントローラの中にポインタ埋め込むとメモリが節約できそうだけど、間接参照が一段深くなって遅くなったりするんだろうか?

std::weak_ptr - cppreference.com
10:58:17 @ikeji@ostatus.ikeji.ma
icon

@tadd 別に定義されてるね。

10:59:09 @ikeji@ostatus.ikeji.ma
icon

@tadd weak_ptrを実装するために、shared_ptrのメモリフットプリントが大きくなってる」と言いたかった

22:18:59 @ikeji@ostatus.ikeji.ma
icon

あれ、いつの間にか世の中では引用RTできるのか

22:20:55 @ikeji@ostatus.ikeji.ma
icon

あれ、南栗橋行きなのに新しい車両だ