jitcraft/FixedArray.cpp
changeset 35 75bdaf9fcb25
parent 28 a9665857cfd5
child 53 13bd3a8df334
     1.1 --- a/jitcraft/FixedArray.cpp	Tue Jul 03 00:43:29 2012 -0700
     1.2 +++ b/jitcraft/FixedArray.cpp	Tue Jul 03 00:45:23 2012 -0700
     1.3 @@ -33,11 +33,10 @@
     1.4          return NULL;
     1.5      }
     1.6  
     1.7 -    Object *obj = zone->allocate(MapKind_FixedArray, SizeFor(length), tenure);
     1.8 -    if (!obj)
     1.9 +    Local<FixedArray> array(zone, FixedArray::cast(zone->allocate(MapKind_FixedArray, SizeFor(length), tenure)));
    1.10 +    if (!array)
    1.11          return NULL;
    1.12  
    1.13 -    FixedArray *array = FixedArray::cast(obj);
    1.14      array->length_ = length;
    1.15      return array;
    1.16  }
    1.17 @@ -51,11 +50,10 @@
    1.18          return NULL;
    1.19      }
    1.20  
    1.21 -    Object *obj = zone->allocate(MapKind_ByteArray, SizeFor(length), tenure);
    1.22 -    if (!obj)
    1.23 +    Local<ByteArray> array(zone, ByteArray::cast(zone->allocate(MapKind_ByteArray, SizeFor(length), tenure)));
    1.24 +    if (!array)
    1.25          return NULL;
    1.26  
    1.27 -    ByteArray *array = ByteArray::cast(obj);
    1.28      array->length_ = length;
    1.29      return array;
    1.30  }