Skip to content

Remove addressed TODO comments #5050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2021
Merged
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: 1 addition & 2 deletions shared-bindings/supervisor/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,13 @@ MP_DEFINE_CONST_FUN_OBJ_0(supervisor_ticks_ms_obj, supervisor_ticks_ms);
//| ...
//|
STATIC mp_obj_t supervisor_get_previous_traceback(void) {
// TODO is this a safe and proper way of making a heap-allocated string object that points at long-lived (and likely long and unique) data outside the heap?
if (prev_traceback_allocation) {
size_t len = strlen((const char *)prev_traceback_allocation->ptr);
if (len > 0) {
mp_obj_str_t *o = m_new_obj(mp_obj_str_t);
o->base.type = &mp_type_str;
o->len = len;
// TODO is it a good assumption that callers probably aren't going to compare this string, so skip computing the hash?
// callers probably aren't going to compare this string, so skip computing the hash
o->hash = 0;
o->data = (const byte *)prev_traceback_allocation->ptr;
return MP_OBJ_FROM_PTR(o);
Expand Down