py/vstr: Combine vstr_new_size with vstr_new since they are rarely used.
Now there is just one function to allocate a new vstr, namely vstr_new (in addition to vstr_init etc). The caller of this function should know what initial size to allocate for the buffer, or at least have some policy or config option, instead of leaving it to a default (as it was before).
This commit is contained in:
@@ -148,7 +148,7 @@ STATIC int pyexec_raw_repl_process_char(int c);
|
||||
STATIC int pyexec_friendly_repl_process_char(int c);
|
||||
|
||||
void pyexec_event_repl_init(void) {
|
||||
MP_STATE_VM(repl_line) = vstr_new_size(32);
|
||||
MP_STATE_VM(repl_line) = vstr_new(32);
|
||||
repl.cont_line = false;
|
||||
readline_init(MP_STATE_VM(repl_line), ">>> ");
|
||||
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
|
||||
|
||||
Reference in New Issue
Block a user