53 | | * A general-purpose resizable array would need these attrs: |
54 | | * element_type (int8, int16, int32, int64, int128, float32, float64, float128, string, pmc) |
55 | | * allocated_size |
56 | | * initialized_size |
57 | | * logical_size |
58 | | * index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) |
| 53 | * What's the difference between "Array" and "ResizeablePMCArray"? |
| 89 | * The current implementations of resizable array PMC's are derived from fixed-sized array PMC's. However the (current) use of the "size" field -- provided by the base PMC -- is arguably incorrect, in that it does not track the allocated size as it would for the fixed-sized version. Instead of changing the meaning of "size" in the base PMC, we should call it "allocated_size", and then in the derived PMC have "logical_size". This means that the memory-safety of the "allocated_size" bound is then implemented only once, within the base PMC. |
| 90 | |
| 91 | * Refactor all the classes as mix-ins between two groups of classes: |
| 92 | # one group of classes that know the type of each element (int, num, str, pmc, any), and |
| 93 | # another group of classes that compute memory addresses for indexed elements, perform resizing (or not), and report number of elements. |
| 94 | (These latter would if necessary target the roles listed above, but a single compromise implementation would also work. -- kurahaupo) |
| 95 | |
| 96 | A general-purpose resizable array would need these attrs: |
| 97 | * element_type (bit, int8, int16, int32, int64, int128, float32, float64, float128, string, pmc, any) |
| 98 | * allocated_size |
| 99 | * initialized_size |
| 100 | * logical_size |
| 101 | * index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) |
| 102 | |