I am undertaking a refactor of the pointer compression loom migration. Refactoring this migration (the only "loom migration" we currently have in the repository) will also serve as scaffolding for future loom migrations.
Currently, pointer compression is implemented as a feature which depends
on a "virtual bits" flag, u3C.vits_w
. This flag is set at runtime based
on the loom's version and is subsequently used by memory management functions.
Using a runtime flag for this feature means that many of these functions were modified to support both compressed and uncompressed pointers (again, based on the runtime flag). While this prevented much code duplication, it also makes future loom migrations (like the one I am trying to write for persistent Nock caching) more difficult. It also adds at least a little bit of performance overhead to the runtime.
- Decouple the pointer compression migration from the runtime flag
u3C.vits_w
and all functions which were modified to support it. - Make the pointer compression migration a compile-time feature.
- Version any functions and structures which are modified by the migration.
- Provide a framework for future loom migrations.
Here, I will maintain a working list of functions and structures which will
need to be versioned, categorized by "package". Most of the "old" versions of
these will go into pkg/noun/{v1|v2|v3|...}
, or similar.
allocate.h
:
u3a_to_off(c3_w som)
-- usesu3C.vits_w
u3a_to_ptr(c3_w som)
-- callsu3a_to_off()
u3a_north_is_senior(r, dog)
-- callsu3a_to_off()
u3a_north_is_junior(r, dog)
-- callsu3a_to_off()
u3a_north_is_normal(r, dog)
-- callsu3a_north_is_senior(),u3a_north_is_junior()
u3a_south_is_senior(r, dog)
-- callsu3a_to_off()
u3a_south_is_junior(r, dog)
-- callsu3a_to_off()
u3a_south_is_normal(r, dog)
-- callsu3a_south_is_senior(),u3a_south_is_junior()
u3a_is_junior(r, som)
-- callsu3a_north_is_junior(),u3a_south_is_junior()
u3a_is_senior(r, som)
-- callsu3a_north_is_senior(),u3a_south_is_senior()
u3a_is_mutable(r, som)
-- callsu3a_is_junior(),u3a_is_senior()
u3a_to_pug(c3_w off)
-- usesu3C.vits_w
u3a_to_pom(c3_w off)
-- usesu3C.vits_w
More later...