CC: | cvicente [...] nsrc.org, regnauld [...] nsrc.org, tobez [...] tobez.org |
Subject: | [PATCH] Provide Storable hooks so that one can freeze/thaw Net::Patricia objects |
Hi,
Currently, it is not possible to nfreeze/thaw or nstore/retrieve
Net::Patricia instances. However, such possibility would be useful for
working with large trees, since freezing/thawing can be made
substantially faster than rebuilding the tree from scratch.
Luckily, Storable provides a mechanism which makes it relatively easy
to implement (see Hooks section in its manpage). Some other XS modules
provide such hooks already, for example Tie::Hash::Indexed.
The attached patch implements this functionality, including the tests.
I tried to keep integers in the serialized data structure in network
byte order to make it work across different platforms.
The patch is tested on FreeBSD/amd64 and Linux/i686.
I hope you will consider adding this to the next release of
Net::Patricia.
\Anton.
Subject: | Net-Patricia-1.19-with-Storable-hooks.patch |
Message body is not shown because it is too large.