Skip to content

Commit 56bd078

Browse files
committed
Speed up qstr loading by using the stack to store a temporary
string instead of the heap.
1 parent 6560596 commit 56bd078

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

py/persistentcode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ STATIC size_t read_uint(mp_reader_t *reader) {
124124

125125
STATIC qstr load_qstr(mp_reader_t *reader) {
126126
size_t len = read_uint(reader);
127-
char *str = m_new(char, len);
127+
char str[len];
128128
read_bytes(reader, (byte*)str, len);
129129
qstr qst = qstr_from_strn(str, len);
130-
m_del(char, str, len);
131130
return qst;
132131
}
133132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy