# HG changeset patch # User Paul Boddie # Date 1490542916 -7200 # Node ID 1f07b0aa675e7c4444a004d4fa67a8a54ebfc98a # Parent 7a592926e9e4e49695e40479d3305c951cc4c4e7 Simplified the tuple instantiator. diff -r 7a592926e9e4 -r 1f07b0aa675e templates/progops.c --- a/templates/progops.c Sun Mar 26 01:50:19 2017 +0100 +++ b/templates/progops.c Sun Mar 26 17:41:56 2017 +0200 @@ -91,13 +91,13 @@ { /* Allocate the tuple and fragment together. */ - __ref obj = (__ref) __ALLOCATE(1, __INSTANCESIZE(__builtins___tuple_tuple) + __FRAGMENT_SIZE(number)); - __attr self = __ATTRVALUE(obj); + __attr self = __new(&__INSTANCETABLE(__builtins___tuple_tuple), + &__builtins___tuple_tuple, + __INSTANCESIZE(__builtins___tuple_tuple) + __FRAGMENT_SIZE(number), 0); - /* Initialise the instance and fragment. */ + /* Initialise the fragment. */ - __init(obj, &__INSTANCETABLE(__builtins___tuple_tuple), &__builtins___tuple_tuple); - __newdata_sequence(self, args, number, (__fragment *) ((void *) obj + __INSTANCESIZE(__builtins___tuple_tuple))); + __newdata_sequence(self, args, number, (__fragment *) ((void *) __VALUE(self) + __INSTANCESIZE(__builtins___tuple_tuple))); return self; }