Jez Higgins

Freelance software grandad
software created
extended or repaired


Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations

Hire me
Contact

Older posts are available in the archive or through tags.

Feed

Arabica

Gone back to working on the my DOM implementation. I'd realised that the reference counting scheme I was using was completely wrong, and the whole thing would be tied up in a circular reference. You can't keep a reference count on each node in the tree, but on the tree as a whole. Given any node, you can always get back to the document node and navigate around, so you have to hold the whole tree until it's all finished with. Once the last reference to any part of the tree is released, then you can destroy the whole tree, but not before.

I've set thing up now so that each node forwards the reference count to its owning document. Once the document is destroyed each node destroys its children. The only thing you have to keep track off then are nodes which have been removed from the tree, or which have been created but not yet added (i.e. those obtained via cloneNode or create*).


Tagged code, arabica, xml, and c++


Jez Higgins

Freelance software grandad
software created
extended or repaired

Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations

Hire me
Contact

Older posts are available in the archive or through tags.

Feed