proc initRef(self: Reference): bool {.gcsafe, locks: 0, raises: [], tags: [].}
proc reference(self: Reference): bool {.gcsafe, locks: 0, raises: [], tags: [].}
proc unreference(self: Reference): bool {.gcsafe, locks: 0, raises: [], tags: [].}