• jim warner's avatar
    top: a tweak to the forest view collapsed code (again) · b3b7a350
    jim warner authored
    From the outset, top has tried to provide some minimal
    garbage collection in support of forest view collapse.
    For example, with every 'v' keystroke, a check is made
    of the currently targeted pids.  If all were negative,
    which means expanded, that Hide_pid array was emptied.
    
    Recently, yet another efficiency was added wherein the
    continuing scan for a targeted pid was terminated when
    a match was found. But, one more inefficiency existed.
    
    When a task which was subject to collapse under forest
    view mode has disappeared (ended), repeatedly scanning
    for such a pid with each iteration makes little sense.
    
    So this commit will negate such targeted pids and thus
    avoid scanning every current task looking for a match.
    Then, if 'v' is ever stuck at some point in the future
    there will be a chance to empty that Hide_pid[] array.
    
    [ hopefully this will be a final tweak of the forest ]
    [ view collapse stuff, but cross your fingers anyway ]
    Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
    b3b7a350
top.c 227 KB