mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Factor AllocationId out of Address (#916)
This lets us statically distinguish between code that works with arbitrary `Address`es and code that can only work with pointers to separately-allocated storage, and so we no longer need to worry about the latter code crashing at run-time (as `Heap::Deallocate` did) or silently doing the wrong thing (as `Heap::PrintAddress` did) if it's given the wrong kind of `Address`.
This commit is contained in:
@@ -44,7 +44,7 @@ class Interpreter {
|
||||
SourceLocation source_loc) -> std::optional<Env>;
|
||||
|
||||
// Support TypeChecker allocating values on the heap.
|
||||
auto AllocateValue(Nonnull<const Value*> v) -> Address {
|
||||
auto AllocateValue(Nonnull<const Value*> v) -> AllocationId {
|
||||
return heap_.AllocateValue(v);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user