From bf333f2a84a1895fe056d213250691e37416e7f7 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 21 Jun 2006 19:58:38 +1000 Subject: [PATCH] Remove common_init and common_destroy. Use halloc instead. darcs-hash:20060621095838-ac50b-e4349a0ab02696cead5397efce3792c9d56c2d15.gz --- common.c | 17 +---------------- common.h | 10 ---------- main.c | 2 -- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/common.c b/common.c index 118edcb80..4eb40095e 100644 --- a/common.c +++ b/common.c @@ -92,20 +92,6 @@ static struct winsize termsize; */ static string_buffer_t *setlocale_buff=0; -void common_destroy() -{ - - if( setlocale_buff ) - { - sb_destroy( setlocale_buff ); - free( setlocale_buff ); - } -} - -void common_init() -{ -} - wchar_t **list_to_char_arr( array_list_t *l ) { wchar_t ** res = malloc( sizeof(wchar_t *)*(al_get_count( l )+1) ); @@ -479,8 +465,7 @@ const wchar_t *wsetlocale(int category, const wchar_t *locale) if( !setlocale_buff ) { - setlocale_buff = malloc( sizeof(string_buffer_t) ); - sb_init( setlocale_buff); + setlocale_buff = sb_halloc( global_context); } sb_clear( setlocale_buff ); diff --git a/common.h b/common.h index 393770692..996f498bd 100644 --- a/common.h +++ b/common.h @@ -250,16 +250,6 @@ int read_blocked(int fd, void *buf, size_t count); */ void die_mem(); -/** - Create global_context using halloc -*/ -void common_init(); - -/** - Free global_context using halloc_free -*/ -void common_destroy(); - /** Issue a debug message with printf-style string formating and automatic line breaking. The string will begin with the string \c diff --git a/main.c b/main.c index 1cfeac994..8cbdcc479 100644 --- a/main.c +++ b/main.c @@ -258,7 +258,6 @@ int main( int argc, char **argv ) no_exec = 0; } - common_init(); halloc_util_init(); proc_init(); @@ -353,7 +352,6 @@ int main( int argc, char **argv ) wutil_destroy(); event_destroy(); - common_destroy(); halloc_util_destroy(); intern_free_all();