fix(scheduler): release replay-event payloads after the simulator pushes them (bug-1884, part 2)
sim_process_replay_event_message() now hands the decoded replay event to the caller, which keeps it beside the translated core event and frees it after xce_core_push_events() with driver.c's release_translated_payload() rules: a pushed config is kept by the core, and a rusages report is kept by the job it found. An untranslatable event is freed at once, and events after the last session are freed at the end. The payloads were an "accepted leak" per event; exit-time leak on the reproduction replay 75,495 -> 25,807 bytes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
880dc51007
commit
c89e4e4520
4 changed files with 101 additions and 23 deletions
|
|
@ -757,15 +757,18 @@ static void test_events_earlier_than_start_snapshot_set_exact(void)
|
|||
struct capn c;
|
||||
capn_ptr root;
|
||||
xce_core_event_t ev;
|
||||
replay_event_t decoded;
|
||||
int record_rc = 0;
|
||||
|
||||
TEST_ASSERT_EQUAL_INT(0, capn_init_fp(&c, start_sim.replay_file, 0));
|
||||
TEST_ASSERT_TRUE(msg_root_has_shape(&c, &root, ReplayEvent_word_count,
|
||||
ReplayEvent_pointer_count));
|
||||
TEST_ASSERT_TRUE(sim_process_replay_event_message(&start_sim, &c, root,
|
||||
&ev, &record_rc)
|
||||
&ev, &decoded,
|
||||
&record_rc)
|
||||
>= 0);
|
||||
TEST_ASSERT_EQUAL_INT(0, record_rc);
|
||||
free_ReplayEvent(&decoded);
|
||||
usleep(WAIT_US / 5);
|
||||
TEST_ASSERT_EQUAL_UINT64_MESSAGE(ev_ts[i],
|
||||
xce_core_now(&(start_sim.core)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue