• Robert Sprowson's avatar
    Call memory allocation functions in matched pairs · 84b74d63
    Robert Sprowson authored
    When dynamic areas are unavailable, the Toolbox memory SWIs fall back to using
    malloc (or calloc) and later free the allocation with OS_Module 7.
    
    However, the CLib now allocates extra to record private information behind the
    allocation so requires a matching call to free to succeed. Toolbox must either
    call malloc/free *or* OS_Module 6/7, not a mixture of the two.
    
    Since realloc from a module is broken in the CLib built into RISC OS 3.10, we opt
    to call OS_Module 6/7 to avoid needing to consider that bug.
    
    Version 1.60. Tagged as 'Toolbox-1_60'
    84b74d63