165 if (self == ByteArray) { |
165 if (self == ByteArray) { |
166 /* |
166 /* |
167 * the most common case |
167 * the most common case |
168 */ |
168 */ |
169 instsize = OHDR_SIZE + nindexedinstvars; |
169 instsize = OHDR_SIZE + nindexedinstvars; |
170 if (__CanDoQuickNew(instsize)) { |
170 if (__CanDoQuickNew(instsize)) { /* OBJECT ALLOCATION */ |
171 __qCheckedNew(newobj, instsize); |
171 __qCheckedNew(newobj, instsize); |
172 __InstPtr(newobj)->o_class = self; |
172 __InstPtr(newobj)->o_class = self; |
173 RETURN (newobj ); |
173 RETURN (newobj ); |
174 } |
174 } |
175 } |
175 } |
176 nInstVars = __intVal(__ClassInstPtr(self)->c_ninstvars); |
176 nInstVars = __intVal(__ClassInstPtr(self)->c_ninstvars); |
177 instsize = OHDR_SIZE + __OBJS2BYTES__(nInstVars) + nindexedinstvars; |
177 instsize = OHDR_SIZE + __OBJS2BYTES__(nInstVars) + nindexedinstvars; |
178 __PROTECT_CONTEXT__ |
178 __PROTECT_CONTEXT__ |
179 __qNew(newobj, instsize); |
179 __qNew(newobj, instsize); /* OBJECT ALLOCATION */ |
180 __UNPROTECT_CONTEXT__ |
180 __UNPROTECT_CONTEXT__ |
181 if (newobj != nil) { |
181 if (newobj != nil) { |
182 __InstPtr(newobj)->o_class = self; |
182 __InstPtr(newobj)->o_class = self; |
183 __qSTORE(newobj, self); |
183 __qSTORE(newobj, self); |
184 if (nInstVars) { |
184 if (nInstVars) { |
1305 if ((index1 <= index2) && (index1 > 0)) { |
1305 if ((index1 <= index2) && (index1 > 0)) { |
1306 if (index2 <= len) { |
1306 if (index2 <= len) { |
1307 count = index2 - index1 + 1; |
1307 count = index2 - index1 + 1; |
1308 __PROTECT_CONTEXT__ |
1308 __PROTECT_CONTEXT__ |
1309 sz = OHDR_SIZE + count; |
1309 sz = OHDR_SIZE + count; |
1310 __qNew(newByteArray, sz); |
1310 __qNew(newByteArray, sz); /* OBJECT ALLOCATION */ |
1311 __UNPROTECT_CONTEXT__ |
1311 __UNPROTECT_CONTEXT__ |
1312 if (newByteArray != nil) { |
1312 if (newByteArray != nil) { |
1313 __InstPtr(newByteArray)->o_class = ByteArray; |
1313 __InstPtr(newByteArray)->o_class = ByteArray; |
1314 dstp = __ByteArrayInstPtr(newByteArray)->ba_element; |
1314 dstp = __ByteArrayInstPtr(newByteArray)->ba_element; |
1315 srcp = __ByteArrayInstPtr(self)->ba_element + index1 - 1; |
1315 srcp = __ByteArrayInstPtr(self)->ba_element + index1 - 1; |
1447 REGISTER int repStartIndex; |
1447 REGISTER int repStartIndex; |
1448 int repStopIndex, count; |
1448 int repStopIndex, count; |
1449 REGISTER unsigned char *dst; |
1449 REGISTER unsigned char *dst; |
1450 OBJ cls; |
1450 OBJ cls; |
1451 |
1451 |
|
1452 #define NO_PRIM_BYTEARR |
|
1453 #ifndef NO_PRIM_BYTEARR |
1452 if (__isBytes(aCollection) |
1454 if (__isBytes(aCollection) |
1453 && __isBytes(self) |
1455 && __isBytes(self) |
1454 && __bothSmallInteger(start, stop) |
1456 && __bothSmallInteger(start, stop) |
1455 && __isSmallInteger(repStart)) { |
1457 && __isSmallInteger(repStart)) { |
1456 startIndex = __intVal(start) - 1; |
1458 startIndex = __intVal(start) - 1; |