Skip to content

Use pointer tagging for *T, **T, and ***T. #3684

@dgryski

Description

@dgryski
- Remove the ptrTo field, it won't be necessary anymore.
- Make sure all type structs are 32-bit aligned. This means the lower two bits of the pointer are zero.
- A type *T can then be represented by adding one to the pointer (this is equivalent to setting the lower bit to one).
- A type **T can be represented by adding two to the pointer.
- Same for ***T. A type ****T cannot be represented this way, we may still need a pointer type.
- Kind() returns PointerType when the lower two bits aren't zero, or else it behaves as it already does.
- Elem() subtracts one from the pointer if it is a pointer type, else it works as it already does.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestreflectionNeeds further work on reflection

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions