0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3303: some structures could be smaller

Problem:    Some structures could be smaller.
Solution:   Rearrange members to reduce size. (Dominique Pellé, closes #8725)
This commit is contained in:
Dominique Pelle
2021-08-07 12:44:41 +02:00
committed by Bram Moolenaar
parent d57a6bd98c
commit 3276f5846f
4 changed files with 14 additions and 12 deletions

View File

@@ -332,8 +332,8 @@ struct wininfo_S
wininfo_T *wi_prev; // previous entry or NULL for first entry wininfo_T *wi_prev; // previous entry or NULL for first entry
win_T *wi_win; // pointer to window that did set wi_fpos win_T *wi_win; // pointer to window that did set wi_fpos
pos_T wi_fpos; // last cursor position in the file 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 winopt_T wi_opt; // local window options
int wi_optset; // TRUE when wi_opt has useful values
#ifdef FEAT_FOLDING #ifdef FEAT_FOLDING
int wi_fold_manual; // copy of w_fold_manual int wi_fold_manual; // copy of w_fold_manual
garray_T wi_folds; // clone of w_folds garray_T wi_folds; // clone of w_folds
@@ -1238,8 +1238,8 @@ struct mapblock
char m_silent; // <silent> used, don't echo commands char m_silent; // <silent> used, don't echo commands
char m_nowait; // <nowait> used char m_nowait; // <nowait> used
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
sctx_T m_script_ctx; // SCTX where map was defined
char m_expr; // <expr> used, m_str is an expression char m_expr; // <expr> used, m_str is an expression
sctx_T m_script_ctx; // SCTX where map was defined
#endif #endif
}; };
@@ -2017,12 +2017,12 @@ struct outer_S {
struct partial_S struct partial_S
{ {
int pt_refcount; // reference count 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 char_u *pt_name; // function name; when NULL use
// pt_func->uf_name // pt_func->uf_name
ufunc_T *pt_func; // function pointer; when NULL lookup function ufunc_T *pt_func; // function pointer; when NULL lookup function
// with pt_name // 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 // For a compiled closure: the arguments and local variables scope
outer_T pt_outer; outer_T pt_outer;
@@ -2030,11 +2030,11 @@ struct partial_S
funcstack_T *pt_funcstack; // copy of stack, used after context funcstack_T *pt_funcstack; // copy of stack, used after context
// function returns // function returns
int pt_argc; // number of arguments
typval_T *pt_argv; // arguments in allocated array typval_T *pt_argv; // arguments in allocated array
int pt_argc; // number of arguments
dict_T *pt_dict; // dict for "self"
int pt_copyID; // funcstack may contain pointer to partial int pt_copyID; // funcstack may contain pointer to partial
dict_T *pt_dict; // dict for "self"
}; };
typedef struct AutoPatCmd_S AutoPatCmd; typedef struct AutoPatCmd_S AutoPatCmd;
@@ -2103,9 +2103,9 @@ struct jobvar_S
PROCESS_INFORMATION jv_proc_info; PROCESS_INFORMATION jv_proc_info;
HANDLE jv_job_object; HANDLE jv_job_object;
#endif #endif
jobstatus_T jv_status;
char_u *jv_tty_in; // controlling tty input, allocated char_u *jv_tty_in; // controlling tty input, allocated
char_u *jv_tty_out; // controlling tty output, allocated char_u *jv_tty_out; // controlling tty output, allocated
jobstatus_T jv_status;
char_u *jv_stoponexit; // allocated char_u *jv_stoponexit; // allocated
#ifdef UNIX #ifdef UNIX
char_u *jv_termsig; // allocated char_u *jv_termsig; // allocated
@@ -3925,8 +3925,8 @@ struct VimMenu
char_u *en_dname; // "dname" untranslated, NULL when "dname" char_u *en_dname; // "dname" untranslated, NULL when "dname"
// was not translated // was not translated
#endif #endif
int mnemonic; // mnemonic key (after '&')
char_u *actext; // accelerator text (after TAB) char_u *actext; // accelerator text (after TAB)
int mnemonic; // mnemonic key (after '&')
int priority; // Menu order priority int priority; // Menu order priority
#ifdef FEAT_GUI #ifdef FEAT_GUI
void (*cb)(vimmenu_T *); // Call-back function void (*cb)(vimmenu_T *); // Call-back function

View File

@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3303,
/**/ /**/
3302, 3302,
/**/ /**/

View File

@@ -456,9 +456,9 @@ struct dfunc_S {
int df_refcount; // how many ufunc_T point to this dfunc_T int df_refcount; // how many ufunc_T point to this dfunc_T
int df_idx; // index in def_functions int df_idx; // index in def_functions
int df_deleted; // if TRUE function was deleted 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 int df_script_seq; // Value of sctx_T sc_seq when the function
// was compiled. // was compiled.
char_u *df_name; // name used for error messages
garray_T df_def_args_isn; // default argument instructions garray_T df_def_args_isn; // default argument instructions
garray_T df_var_names; // names of local vars garray_T df_var_names; // names of local vars
@@ -466,12 +466,12 @@ struct dfunc_S {
// After compiling "df_instr" and/or "df_instr_prof" is not NULL. // After compiling "df_instr" and/or "df_instr_prof" is not NULL.
isn_T *df_instr; // function body to be executed isn_T *df_instr; // function body to be executed
int df_instr_count; // size of "df_instr" 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 #ifdef FEAT_PROFILE
isn_T *df_instr_prof; // like "df_instr" with profiling isn_T *df_instr_prof; // like "df_instr" with profiling
int df_instr_prof_count; // size of "df_instr_prof" int df_instr_prof_count; // size of "df_instr_prof"
#endif #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_varcount; // number of local variables
int df_has_closure; // one if a closure was created int df_has_closure; // one if a closure was created

View File

@@ -85,8 +85,8 @@ struct ectx_S {
garray_T ec_trystack; // stack of trycmd_T values garray_T ec_trystack; // stack of trycmd_T values
int ec_dfunc_idx; // current function index
isn_T *ec_instr; // array with instructions isn_T *ec_instr; // array with instructions
int ec_dfunc_idx; // current function index
int ec_iidx; // index in ec_instr: instruction to execute int ec_iidx; // index in ec_instr: instruction to execute
garray_T ec_funcrefs; // partials that might be a closure garray_T ec_funcrefs; // partials that might be a closure