From 455fbac64f101b05f7eaca89b84470569e4df3fd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 19 Jan 2016 23:18:03 -0800 Subject: 2576 - distinguish allocated addresses from others This is the one major refinement on the C programming model I'm planning to introduce in mu. Instead of Rust's menagerie of pointer types and static checking, I want to introduce just one new type, and use it to perform ref-counting at runtime. So far all we're doing is updating new's interface. The actual ref-counting implementation is next. One implication: I might sometimes need duplicate implementations for a recipe with allocated vs vanilla addresses of the same type. So far it seems I can get away with just always passing in allocated addresses; the situations when you want to pass an unallocated address to a recipe should be few and far between. --- 032array.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to '032array.cc') diff --git a/032array.cc b/032array.cc index f5fe2775..dbc6a4dc 100644 --- a/032array.cc +++ b/032array.cc @@ -430,8 +430,10 @@ bool is_mu_string(const reagent& x) { return x.type && x.type->value == get(Type_ordinal, "address") && x.type->right - && x.type->right->value == get(Type_ordinal, "array") + && x.type->right->value == get(Type_ordinal, "shared") && x.type->right->right - && x.type->right->right->value == get(Type_ordinal, "character") - && x.type->right->right->right == NULL; + && x.type->right->right->value == get(Type_ordinal, "array") + && x.type->right->right->right + && x.type->right->right->right->value == get(Type_ordinal, "character") + && x.type->right->right->right->right == NULL; } -- cgit 1.4.1-2-gfad0 diff/horizon?h=hlt&id=e17817c7e0bd6f8bff6d621641f6826fe3f8b68e'>diff stats
path: root/horizon
blob: b384e30d696ae092606d2b973a9ffe962e8046e2 (plain) (tree)