this commit adds a mechanism to statically declare attach/detach and ref/unref methods, for objects that are only accessed within a single C file.
this commit adds a mechanism to statically declare attach/detach and ref/unref methods, for objects that are only accessed within a single C file.