Skip to content

Commit

Permalink
Fix a few minor issues (#2049)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperl authored Jan 23, 2024
1 parent 3df7c4f commit 01ea67a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/primitive_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ PRIMITIVE(rtc_user_bytes) {
if (result == null) FAIL(ALLOCATION_FAILED);
return result;
}
#elif !defined(TOIT_FREERTOS)
#else
PRIMITIVE(rtc_user_bytes) {
static uint8 rtc_memory[4096];
ByteArray* result = process->object_heap()->allocate_external_byte_array(
Expand Down
5 changes: 3 additions & 2 deletions src/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,10 @@ void Scheduler::run_process(Locker& locker, Process* process, SchedulerThread* s
case Interpreter::Result::TERMINATED: {
wait_for_any_gc_to_complete(locker, process, Process::RUNNING);

int id = process->id();
ProcessGroup* group = process->group();
bool last_in_group = !group->remove(process);
ASSERT(group->lookup(process->id()) == null);
ASSERT(group->lookup(id) == null);
SystemMessage* message = process->take_termination_message(result.value());

// Deleting processes might need to take the event source lock, so we have
Expand All @@ -709,7 +710,7 @@ void Scheduler::run_process(Locker& locker, Process* process, SchedulerThread* s
// the boot process that is going away.
if (send_system_message(locker, message) != MESSAGE_OK) {
#ifdef TOIT_FREERTOS
printf("[message: cannot send termination message for pid %d]\n", process->id());
printf("[message: cannot send termination message for pid %d]\n", id);
#endif
delete message;
}
Expand Down

0 comments on commit 01ea67a

Please sign in to comment.