diff options
author | 2006-11-16 23:08:33 +1000 | |
---|---|---|
committer | 2006-11-16 23:08:33 +1000 | |
commit | 0105ec284d7939815c6643781c1de5e67317b459 (patch) | |
tree | b361db319e58e13a15abd271d141262269f19060 /complete.c | |
parent | 55b253152cfbaa1a330a31a3c257424e6a33eb15 (diff) |
Don't intern as much completion data - this helps reduce memory usage when autounloading
darcs-hash:20061116130833-ac50b-b19887dc36b16476bb3b2a1593b23dd3325187ee.gz
Diffstat (limited to 'complete.c')
-rw-r--r-- | complete.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -353,7 +353,7 @@ static void complete_free_opt_recursive( complete_entry_opt_t *o ) { if( o->next != 0 ) complete_free_opt_recursive( o->next ); - free(o); + halloc_free( o ); } /** @@ -430,10 +430,7 @@ void complete_add( const wchar_t *cmd, c->short_opt_str = wcsdup(L""); } - if( !(opt = malloc( sizeof( complete_entry_opt_t ) ))) - { - DIE_MEM(); - } + opt = halloc( 0, sizeof( complete_entry_opt_t ) ); opt->next = c->first_option; c->first_option = opt; @@ -456,13 +453,13 @@ void complete_add( const wchar_t *cmd, opt->result_mode = result_mode; opt->old_mode=old_mode; - opt->comp = intern(comp?comp:L""); - opt->condition = intern(condition?condition:L""); - opt->long_opt = intern( long_opt?long_opt:L"" ); + opt->comp = comp?halloc_wcsdup(opt, comp):L""; + opt->condition = condition?halloc_wcsdup(opt, condition):L""; + opt->long_opt = long_opt?halloc_wcsdup(opt, long_opt):L"" ; if( desc && wcslen( desc ) ) { - opt->desc = intern( desc ); + opt->desc = halloc_wcsdup( opt, desc ); } else { |