Ticket #1434 (new RFC)
Slim down selection of mathematics vtables
Reported by: | whiteknight | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Version: | 2.0.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
We have far too many mathematics vtables for too many combinations of input arguments. I would like to make the following suggestions:
- Convert all "3-argument" VTABLEs to "2-argument" ones. These are of the form "PMC * foo(PMC *value, PMC *dest)". VTABLEs of this form are extremely inconsistent throughout the codebase for the handling of the third "dest" argument. In many implementations the third argument is completely unused. I suggest they should all be changed to "PMC *foo(PMC *value)", and always return a new PMC that contains the resultant value.
- Remove all "i_*" vtables. These are less frequently used and tend to be implemented internally in terms of the 3-argument vtables.
These changes will signficantly reduce bloat of the VTABLE structure and decrease Parrot's memory footprint and startup times. We'll also be able to have more consistent implementations of the math ops across all core types, and will have a much lower maintenance burden if we need to make changes to these operations.
Change History
Note: See
TracTickets for help on using
tickets.