20649
|
1 |
"{ Package: 'stx:libbasic' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
UnboxedIntegerArray variableSignedWordSubclass:#SignedWordArray
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Collections-Arrayed'
|
|
10 |
!
|
|
11 |
|
24714
|
12 |
!SignedWordArray class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
SignedWordArrays store 16bit signed integers in the range 16r-8000..16r7FFF.
|
|
17 |
They are much like WordArrays, but the values stored are signed.
|
|
18 |
In contrast to normal arrays (which store pointers to their elements),
|
|
19 |
signedWordArrays store the values in a dense & compact way.
|
|
20 |
Since the representation fits the underlying C-language systems representation
|
|
21 |
of signed int16's, this is also useful to pass bulk data to c primitive code.
|
|
22 |
|
|
23 |
Therefore, SignedWordArrays can be used to hold bulk data in a more compact way.
|
|
24 |
For example:
|
|
25 |
Array new:100000 withAll:1
|
|
26 |
requires 400k of object memory;
|
|
27 |
|
|
28 |
in contrast,
|
|
29 |
SignedWordArray new:100000 withAll:1
|
|
30 |
only requires half of it.
|
|
31 |
|
|
32 |
[memory requirements:]
|
|
33 |
OBJ-HEADER + (size * 2)
|
|
34 |
|
|
35 |
[see also:]
|
|
36 |
ByteArray WordArray BooleanArray FloatArray DoubleArray Array
|
|
37 |
IntegerArray LongIntegerArray SignedLongIntegerArray
|
|
38 |
|
|
39 |
[caveat:]
|
|
40 |
should probably be renamed to SignedInt16Array or Int16Array
|
|
41 |
|
|
42 |
[author:]
|
|
43 |
Claus Gittinger
|
|
44 |
"
|
|
45 |
! !
|
20649
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
24714
|
50 |
!SignedWordArray class methodsFor:'documentation'!
|
22272
|
51 |
|
24714
|
52 |
version_CVS
|
|
53 |
^ '$Header$'
|
|
54 |
! !
|
|
55 |
|