Changes between Version 16 and Version 17 of ArrayTasklist

Show
Ignore:
Timestamp:
10/24/09 03:10:02 (5 years ago)
Author:
kurahaupo
Comment:

Add reference to RT#56718; tidy page

Legend:

Unmodified
Added
Removed
Modified
  • ArrayTasklist

    v16 v17  
    8989 * 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. 
    9090 
    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) 
     91== Refactoring == 
     92Refactor all the classes as mix-ins between two groups of classes: 
    9593 
    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) 
     94* one group of classes that know the type of each element (int, num, str, pmc, any), and 
     95* another group of classes that compute memory addresses for indexed elements, perform resizing (or not), and report number of elements. 
     96 
     97(These latter would if necessary target the roles listed above, but a single compromise implementation would also work. -- kurahaupo) 
     98 
     99A general-purpose resizable array would need these attrs: 
     100* element_size (corresponding to int8, int16, int32, int64, int128, float32, float64, float128, string, pmc & any) 
     101* allocated_size 
     102* initialized_size 
     103* logical_size 
     104* index_offset (used to make shift and unshift operate efficiently, not to allow arbitrary base indexing) 
     105 
     106A general-purpose fixed-sized array would only need the element size and number of elements. 
    102107 
    103108= Related Tickets = 
     
    109114 * #218 can't sort a PIR subclass of an ResizablePMCArray 
    110115 * #159 Deprecated: named class/pmc lookup in pir syntax such as new, isa, subclass, get_class, etc 
     116 
     117 * RT#56718