• Jeffrey Lee's avatar
    Fix combined freepool + appspace shrink · 76d04b25
    Jeffrey Lee authored
    When a DA tries to grow by more than the free pool size, the kernel
    should try to take the necessary remaining amount from application
    space. Historically this was handled as a combined "take from freepool
    and appspace" operation, but with Kernel-5_35-4_79_2_284 this was
    changed to use a nested call to OS_ChangeDynamicArea, so first appspace
    is shrunk into the free pool and then the target DA is grown using just
    the free pool.
    However the code was foolishly trying to use ChangeDyn_AplSpace as the
    argument to OS_ChangeDynamicArea, which that call doesn't recognise as a
    valid DA number. Change it to use ChangeDyn_FreePool ("grow free pool
    from appspace"), and also fix up a stack imbalance that would have
    caused it to misbehave regardless of the outcome.
ChangeDyn 265 KB