1.1 --- a/templates/native/common.c Tue Mar 21 01:15:38 2017 +0100
1.2 +++ b/templates/native/common.c Tue Mar 21 18:08:44 2017 +0100
1.3 @@ -28,6 +28,12 @@
1.4
1.5 __attr __new_int(int i)
1.6 {
1.7 + /* Search the integer cache first. */
1.8 + if ((i >= 0) && (i < __INTEGER_CACHE_SIZE))
1.9 + {
1.10 + return __ATTRVALUE((__ref) &__integer_cache[i]);
1.11 + }
1.12 +
1.13 /* Create a new integer and mutate the __data__ attribute. */
1.14 __attr attr = __NEWINSTANCE(__builtins___int_int);
1.15 attr.value->attrs[__ATTRPOS(__data__)].intvalue = i;