To: vim_dev@googlegroups.com Subject: Patch 8.2.3303 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3303 Problem: Some structures could be smaller. Solution: Rearrange members to reduce size. (Dominique Pellé, closes #8725) Files: src/structs.h, src/vim9.h, src/vim9execute.c *** ../vim-8.2.3302/src/structs.h 2021-08-03 18:33:04.651157866 +0200 --- src/structs.h 2021-08-07 12:40:39.652836648 +0200 *************** *** 332,339 **** wininfo_T *wi_prev; // previous entry or NULL for first entry win_T *wi_win; // pointer to window that did set wi_fpos pos_T wi_fpos; // last cursor position in the file - int wi_optset; // TRUE when wi_opt has useful values winopt_T wi_opt; // local window options #ifdef FEAT_FOLDING int wi_fold_manual; // copy of w_fold_manual garray_T wi_folds; // clone of w_folds --- 332,339 ---- wininfo_T *wi_prev; // previous entry or NULL for first entry win_T *wi_win; // pointer to window that did set wi_fpos pos_T wi_fpos; // last cursor position in the file winopt_T wi_opt; // local window options + int wi_optset; // TRUE when wi_opt has useful values #ifdef FEAT_FOLDING int wi_fold_manual; // copy of w_fold_manual garray_T wi_folds; // clone of w_folds *************** *** 1238,1245 **** char m_silent; // used, don't echo commands char m_nowait; // used #ifdef FEAT_EVAL - sctx_T m_script_ctx; // SCTX where map was defined char m_expr; // used, m_str is an expression #endif }; --- 1238,1245 ---- char m_silent; // used, don't echo commands char m_nowait; // used #ifdef FEAT_EVAL char m_expr; // used, m_str is an expression + sctx_T m_script_ctx; // SCTX where map was defined #endif }; *************** *** 2017,2028 **** struct partial_S { int pt_refcount; // reference count char_u *pt_name; // function name; when NULL use // pt_func->uf_name ufunc_T *pt_func; // function pointer; when NULL lookup function // with pt_name - int pt_auto; // when TRUE the partial was created for using - // dict.member in handle_subscript() // For a compiled closure: the arguments and local variables scope outer_T pt_outer; --- 2017,2028 ---- struct partial_S { int pt_refcount; // reference count + int pt_auto; // when TRUE the partial was created for using + // dict.member in handle_subscript() char_u *pt_name; // function name; when NULL use // pt_func->uf_name ufunc_T *pt_func; // function pointer; when NULL lookup function // with pt_name // For a compiled closure: the arguments and local variables scope outer_T pt_outer; *************** *** 2030,2040 **** funcstack_T *pt_funcstack; // copy of stack, used after context // function returns - int pt_argc; // number of arguments typval_T *pt_argv; // arguments in allocated array - dict_T *pt_dict; // dict for "self" int pt_copyID; // funcstack may contain pointer to partial }; typedef struct AutoPatCmd_S AutoPatCmd; --- 2030,2040 ---- funcstack_T *pt_funcstack; // copy of stack, used after context // function returns typval_T *pt_argv; // arguments in allocated array + int pt_argc; // number of arguments int pt_copyID; // funcstack may contain pointer to partial + dict_T *pt_dict; // dict for "self" }; typedef struct AutoPatCmd_S AutoPatCmd; *************** *** 2103,2111 **** PROCESS_INFORMATION jv_proc_info; HANDLE jv_job_object; #endif char_u *jv_tty_in; // controlling tty input, allocated char_u *jv_tty_out; // controlling tty output, allocated - jobstatus_T jv_status; char_u *jv_stoponexit; // allocated #ifdef UNIX char_u *jv_termsig; // allocated --- 2103,2111 ---- PROCESS_INFORMATION jv_proc_info; HANDLE jv_job_object; #endif + jobstatus_T jv_status; char_u *jv_tty_in; // controlling tty input, allocated char_u *jv_tty_out; // controlling tty output, allocated char_u *jv_stoponexit; // allocated #ifdef UNIX char_u *jv_termsig; // allocated *************** *** 3925,3932 **** char_u *en_dname; // "dname" untranslated, NULL when "dname" // was not translated #endif - int mnemonic; // mnemonic key (after '&') char_u *actext; // accelerator text (after TAB) int priority; // Menu order priority #ifdef FEAT_GUI void (*cb)(vimmenu_T *); // Call-back function --- 3925,3932 ---- char_u *en_dname; // "dname" untranslated, NULL when "dname" // was not translated #endif char_u *actext; // accelerator text (after TAB) + int mnemonic; // mnemonic key (after '&') int priority; // Menu order priority #ifdef FEAT_GUI void (*cb)(vimmenu_T *); // Call-back function *** ../vim-8.2.3302/src/vim9.h 2021-06-26 21:20:59.791632565 +0200 --- src/vim9.h 2021-08-07 12:40:39.652836648 +0200 *************** *** 456,464 **** int df_refcount; // how many ufunc_T point to this dfunc_T int df_idx; // index in def_functions int df_deleted; // if TRUE function was deleted - char_u *df_name; // name used for error messages int df_script_seq; // Value of sctx_T sc_seq when the function // was compiled. garray_T df_def_args_isn; // default argument instructions garray_T df_var_names; // names of local vars --- 456,464 ---- int df_refcount; // how many ufunc_T point to this dfunc_T int df_idx; // index in def_functions int df_deleted; // if TRUE function was deleted int df_script_seq; // Value of sctx_T sc_seq when the function // was compiled. + char_u *df_name; // name used for error messages garray_T df_def_args_isn; // default argument instructions garray_T df_var_names; // names of local vars *************** *** 466,477 **** // After compiling "df_instr" and/or "df_instr_prof" is not NULL. isn_T *df_instr; // function body to be executed int df_instr_count; // size of "df_instr" #ifdef FEAT_PROFILE isn_T *df_instr_prof; // like "df_instr" with profiling int df_instr_prof_count; // size of "df_instr_prof" #endif - isn_T *df_instr_debug; // like "df_instr" with debugging - int df_instr_debug_count; // size of "df_instr_debug" int df_varcount; // number of local variables int df_has_closure; // one if a closure was created --- 466,477 ---- // After compiling "df_instr" and/or "df_instr_prof" is not NULL. isn_T *df_instr; // function body to be executed int df_instr_count; // size of "df_instr" + int df_instr_debug_count; // size of "df_instr_debug" + isn_T *df_instr_debug; // like "df_instr" with debugging #ifdef FEAT_PROFILE isn_T *df_instr_prof; // like "df_instr" with profiling int df_instr_prof_count; // size of "df_instr_prof" #endif int df_varcount; // number of local variables int df_has_closure; // one if a closure was created *** ../vim-8.2.3302/src/vim9execute.c 2021-08-02 19:10:30.961721085 +0200 --- src/vim9execute.c 2021-08-07 12:40:39.652836648 +0200 *************** *** 85,92 **** garray_T ec_trystack; // stack of trycmd_T values - int ec_dfunc_idx; // current function index isn_T *ec_instr; // array with instructions int ec_iidx; // index in ec_instr: instruction to execute garray_T ec_funcrefs; // partials that might be a closure --- 85,92 ---- garray_T ec_trystack; // stack of trycmd_T values isn_T *ec_instr; // array with instructions + int ec_dfunc_idx; // current function index int ec_iidx; // index in ec_instr: instruction to execute garray_T ec_funcrefs; // partials that might be a closure *** ../vim-8.2.3302/src/version.c 2021-08-07 12:31:53.689892833 +0200 --- src/version.c 2021-08-07 12:41:05.044776764 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3303, /**/ -- Q: Is selling software the same as selling hardware? A: No, good hardware is sold new, good software has already been used by many. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///