| ▲ | blt 3 hours ago | |
Another benefit the article doesn't mention: these intrusive lists seem a good soft defense against use-after-free bugs in C. The node struct knows about all containers to which it belongs, so writing the "destructor" is very local. With the pointer array equivalent, one can only identify the arrays that point to the object by understanding the surrounding codebase. (Disclaimer: I am not speaking from experience here. My C background is mostly static allocation.) | ||