Advice needed for garbage collection changes

Help
Tieske
2012-05-08
2012-12-14
  • Tieske
    Tieske
    2012-05-08

    Requesting some advice, see this commit.

    I'm building a binding for a scripting language with automatic garbage collection. The IXML tree structure is troublesome because I have to recreate the full tree logic on the script side. Because this is such a PITA (many tree traversals required to release something properly), I added a custom tag (void*) to the Node object, which makes it easy to track the resources and free them when appropriate.

    I haven't done any testing, so please DO NOT yet integrate it. I just would like feedback on whether this would be accepted as a change, because I would like to stick to the standard library. If it won't , then I'll drop my efforts and will start working on recreating the entire tree.

    Besides the 'ctag' and the methods to get and set them, there is also a callback (with get and set methods) that will be called upon freeing a node, also to notify the script side that an object is going out of scope.

    Preferably I would like to drop the compiler directive SCRIPTSUPPORT, and have it included by default. The cost is only 1 extra pointer per Node.

    Please advice.

    Regards
    Thijs

    PS. posted this initially on github, only to find out later I should have done it here. Closing the github issue now.

     
  • Hi Thijs,

    Sorry for taking so long to answer.

    I took a look at your commit on github, and I see no problem with your patch, since you have been careful to add a compiler conditional.

    Please go on, when it is done we will integrate it.

    Regards,
    Marcelo.