Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion py/objstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,8 @@ mp_obj_t mp_obj_new_str_copy(const mp_obj_type_t *type, const byte *data, size_t
o->len = len;
if (data) {
o->hash = qstr_compute_hash(data, len);
byte *p = m_new(byte, len + 1);
// CIRCUITPY-CHANGE: Don't scan string data for pointers.
byte *p = m_malloc_without_collect(sizeof(byte) * (len + 1));
o->data = p;
memcpy(p, data, len * sizeof(byte));
p[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings
Expand Down
3 changes: 2 additions & 1 deletion py/objstringio.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static mp_uint_t stringio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *er

static void stringio_copy_on_write(mp_obj_stringio_t *o) {
const void *buf = o->vstr->buf;
o->vstr->buf = m_new(char, o->vstr->len);
// CIRCUITPY-CHANGE: Don't scan string data for pointers.
o->vstr->buf = m_malloc_without_collect(sizeof(char) * o->vstr->len);
o->vstr->fixed_buf = false;
o->ref_obj = MP_OBJ_NULL;
memcpy(o->vstr->buf, buf, o->vstr->len);
Expand Down
3 changes: 2 additions & 1 deletion py/vstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void vstr_init(vstr_t *vstr, size_t alloc) {
}
vstr->alloc = alloc;
vstr->len = 0;
vstr->buf = m_new(char, vstr->alloc);
// CIRCUITPY-CHANGE: Don't scan string data for pointers.
vstr->buf = m_malloc_without_collect(sizeof(char) * vstr->alloc);
vstr->fixed_buf = false;
}

Expand Down
Loading