Array.st
changeset 3730 375237229a8e
parent 3500 90eb689740cc
child 3979 46a2da9b917d
equal deleted inserted replaced
3729:dfb4670c8b1f 3730:375237229a8e
   458 	__qAlignedNew(nObj, sz);        /* OBJECT ALLOCATION */
   458 	__qAlignedNew(nObj, sz);        /* OBJECT ALLOCATION */
   459 	__UNPROTECT2__(self, something);
   459 	__UNPROTECT2__(self, something);
   460 
   460 
   461 	if (nObj) {
   461 	if (nObj) {
   462 	    __InstPtr(nObj)->o_class = Array;
   462 	    __InstPtr(nObj)->o_class = Array;
       
   463 	    __STORE(nObj, Array);
   463 
   464 
   464 	    nIndex = __BYTES2OBJS__(sz - OHDR_SIZE - sizeof(OBJ));
   465 	    nIndex = __BYTES2OBJS__(sz - OHDR_SIZE - sizeof(OBJ));
   465 	    /* 
   466 	    /* 
   466 	     * sorry: 
   467 	     * sorry: 
   467 	     * cannot use bcopy, since we must take care of stores ... 
   468 	     * cannot use bcopy, since we must take care of stores ... 
  1392 		{
  1393 		{
  1393 		    int n4 = endIndex-index+1;
  1394 		    int n4 = endIndex-index+1;
  1394 
  1395 
  1395 		    memset4(dst, anObject, n4);
  1396 		    memset4(dst, anObject, n4);
  1396 		}
  1397 		}
  1397 		__STORE(self, anObject);
       
  1398 #else
  1398 #else
  1399 # ifdef FAST_MEMSET
  1399 # ifdef FAST_MEMSET
  1400 		if ((INT)anObject == 0) {
  1400 		if ((INT)anObject == 0) {
  1401 		    memset(dst, 0, __OBJS2BYTES__(endIndex-index+1));
  1401 		    memset(dst, 0, __OBJS2BYTES__(endIndex-index+1));
  1402 		} else 
  1402 		} else 
  1415 		    }
  1415 		    }
  1416 # endif
  1416 # endif
  1417 		    for (; index <= endIndex; index++) {
  1417 		    for (; index <= endIndex; index++) {
  1418 			*dst++ = anObject;
  1418 			*dst++ = anObject;
  1419 		    }
  1419 		    }
  1420 		    __STORE(self, anObject);
  1420 		}
  1421 		}
  1421 #endif
  1422 #endif
  1422 		__STORE(self, anObject);
  1423 		RETURN ( self );
  1423 		RETURN ( self );
  1424 	    }
  1424 	    }
  1425 	}
  1425 	}
  1426     }
  1426     }
  1427 %}.
  1427 %}.
  1555                         } else {
  1555                         } else {
  1556                             REGISTER int spc;
  1556                             REGISTER int spc;
  1557 
  1557 
  1558                             spc = __qSpace(self);
  1558                             spc = __qSpace(self);
  1559 #if defined(UNROLL_LOOPS)
  1559 #if defined(UNROLL_LOOPS)
  1560                             while (count >= 4) {
  1560                             while (count >= 8) {
  1561                                 t = src[0]; dst[0] = t; __STORE_SPC(self, t, spc);
  1561                                 t = src[0]; dst[0] = t; __STORE_SPC(self, t, spc);
  1562                                 t = src[1]; dst[1] = t; __STORE_SPC(self, t, spc);
  1562                                 t = src[1]; dst[1] = t; __STORE_SPC(self, t, spc);
  1563                                 t = src[2]; dst[2] = t; __STORE_SPC(self, t, spc);
  1563                                 t = src[2]; dst[2] = t; __STORE_SPC(self, t, spc);
  1564                                 t = src[3]; dst[3] = t; __STORE_SPC(self, t, spc);
  1564                                 t = src[3]; dst[3] = t; __STORE_SPC(self, t, spc);
  1565                                 count -= 4; src += 4; dst += 4;
  1565                                 t = src[4]; dst[4] = t; __STORE_SPC(self, t, spc);
       
  1566                                 t = src[5]; dst[5] = t; __STORE_SPC(self, t, spc);
       
  1567                                 t = src[6]; dst[6] = t; __STORE_SPC(self, t, spc);
       
  1568                                 t = src[7]; dst[7] = t; __STORE_SPC(self, t, spc);
       
  1569                                 count -= 8; src += 8; dst += 8;
  1566                             }
  1570                             }
  1567 #endif
  1571 #endif
  1568                             while (count-- > 0) {
  1572                             while (count-- > 0) {
  1569                                 t = *src++;
  1573                                 t = *src++;
  1570                                 *dst++ = t;
  1574                                 *dst++ = t;
  2308 ! !
  2312 ! !
  2309 
  2313 
  2310 !Array class methodsFor:'documentation'!
  2314 !Array class methodsFor:'documentation'!
  2311 
  2315 
  2312 version
  2316 version
  2313     ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.109 1998-06-04 01:18:28 cg Exp $'
  2317     ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.110 1998-08-05 09:24:20 cg Exp $'
  2314 ! !
  2318 ! !