Author: sparky Date: Sun Oct 5 20:21:41 2008 GMT Module: SOURCES Tag: HEAD ---- Log message: - don't put so huge data on the stack, use malloc
---- Files affected: SOURCES: vifm-use_malloc.patch (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: SOURCES/vifm-use_malloc.patch diff -u /dev/null SOURCES/vifm-use_malloc.patch:1.1 --- /dev/null Sun Oct 5 22:21:41 2008 +++ SOURCES/vifm-use_malloc.patch Sun Oct 5 22:21:35 2008 @@ -0,0 +1,34 @@ +--- vifm-0.4/src/vifm.c~ 2008-06-13 23:06:20.000000000 +0200 ++++ vifm-0.4/src/vifm.c 2008-10-05 22:15:40.000000000 +0200 +@@ -40,7 +40,7 @@ + + Config cfg; + Status curr_stats; +-Col_scheme col_schemes[8]; ++Col_scheme *col_schemes; + + static void + show_help_msg(void) +@@ -109,9 +109,10 @@ + cfg.cmd_history = (char **)calloc(cfg.cmd_history_len, sizeof(char *)); + cfg.auto_execute = 0; + cfg.color_scheme_num = 0; +- //col_schemes = (Col_scheme *)calloc(1, sizeof(Col_scheme*)); + cfg.color_pairs_num = 0; + ++ col_schemes = malloc( sizeof( Col_scheme ) * 8 ); ++ + /* Maximum argument length to pass to the shell */ + if (! (cfg.max_args = sysconf(_SC_ARG_MAX)) > 0) + cfg.max_args = 4096; /* POSIX MINIMUM */ +--- vifm-0.4/src/color_scheme.h~ 2008-06-12 03:26:04.000000000 +0200 ++++ vifm-0.4/src/color_scheme.h 2008-10-05 22:15:52.000000000 +0200 +@@ -48,7 +48,7 @@ + Col_attr color[12]; + } Col_scheme; + +-extern Col_scheme col_schemes[8];; ++extern Col_scheme *col_schemes; + + void read_color_scheme_file(); + void write_color_scheme_file(); ================================================================ _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
