aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-11-16 23:08:33 +1000
committerGravatar axel <axel@liljencrantz.se>2006-11-16 23:08:33 +1000
commit0105ec284d7939815c6643781c1de5e67317b459 (patch)
treeb361db319e58e13a15abd271d141262269f19060 /complete.c
parent55b253152cfbaa1a330a31a3c257424e6a33eb15 (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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/complete.c b/complete.c
index ba7de179..028cf86d 100644
--- a/complete.c
+++ b/complete.c
@@ -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
{