Ignore:
Timestamp:
Jan 23, 2015, 10:46:30 PM (10 years ago)
Author:
bird
Message:

kmk: Save 20+ MB of memory for chopped receipt command lines by freeing them after we're done evaluating a target.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/commands.c

    r2664 r2753  
    633633
    634634
     635#ifdef KMK
     636/* This is for saving memory in func_commands. */
     637void
     638free_chopped_commands (struct commands *cmds)
     639{
     640  if (cmds && cmds->command_lines != 0)
     641    {
     642      unsigned idx = cmds->ncommand_lines;
     643      while (idx-- > 0)
     644        free (cmds->command_lines[idx]);
     645      free (cmds->command_lines);
     646      free (cmds->lines_flags);
     647      cmds->command_lines = NULL;
     648      cmds->lines_flags = NULL;
     649    }
     650}
     651
     652
     653#endif /* CONFIG_WITH_COMMANDS_FUNC */
    635654/* Execute the commands to remake FILE.  If they are currently executing,
    636655   return or have already finished executing, just return.  Otherwise,
Note: See TracChangeset for help on using the changeset viewer.