Title | ChainCreate calls ControlAlloc twice |
Status | closed |
Priority | nice |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | ChainCreate calls ControlAlloc once to allocate the array of GenDescStruct and another to allocate the ChainStruct. But this is unnecessary: since both sets of structures are required, they could be done in one allocation. Other cases where there are multiple calls to ControlAlloc that could be combined are AWLSegInit and loSegInit. In TraceIdMessagesCreate there are two allocations but they are freed at separate points in time so although MVFF supports freeing memory with different sizes from allocation, we should make ControlFree match ControlAlloc to give us flexibility when replacing the control pool. Allocating once would be quicker, and would avoid the need for unwind logic for the failure case, which tends to be hard to cover by test cases (job003482). |
Analysis | Perhaps allocating more smaller objects makes it easier to pack them into memory? Seems unlikely. |
How found | inspection |
Evidence | None |
Created by | Gareth Rees |
Created on | 2018-07-02 11:01:04 |
Last modified by | Gareth Rees |
Last modified on | 2018-07-06 18:56:12 |
History | 2018-07-02 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
194484 | closed | 2018-07-06 18:56:12 | Gareth Rees | Don't make multiple calls to ControlAlloc when you could just make one and divvy it up yourself. |