top | item 43682803

(no title)

paraboul | 10 months ago

> the same object can be part of multiple containers at once

I'm not sure I understand this one. Since the object contains the reference to where it belongs inside a container (e.g. object.node.next) how can it be re-used in multiple containers. Conversely, in a non-intrusive data structure, multiple containers can hold a ref to the same object through an intermediate node object

discuss

order

gnubison|10 months ago

You add multiple next variables. buffer.next, buffer.next_displayed, etc

paraboul|10 months ago

That's not an advantage of intrusive data structures then. That's precisely an advantage of non-intrusive data structure : object can be inserted in an arbitrary number of containers

Zambyte|10 months ago

The object can contain multiple intrusive node fields.