Remove the concept of the 'stdio channel' from class DrivenEngine

This commit is contained in:
2025-12-18 15:28:05 -05:00
parent a9a5e52a23
commit 3dd6894305
3 changed files with 12 additions and 34 deletions

View File

@@ -37,7 +37,9 @@ DrivenEngineInitializerReg::DrivenEngineInitializerReg(DrivenEngineInitializer f
//////////////////////////////////////////////////////////////////////////////
int DrivenEngine::find_unused_chid() {
// Note: channel ID zero is special, it is never reused.
// Note: channel ID zero is never used. Channel ID 0 used to be
// reserved for the stdio channel. When we eliminated the stdio
// channel, we blocked off ID 0 permanently.
for (int i = 0; i < DRV_MAX_CHAN; i++) {
int id = next_unused_chid_++;
if (next_unused_chid_ == DRV_MAX_CHAN) next_unused_chid_ = 1;
@@ -48,6 +50,7 @@ int DrivenEngine::find_unused_chid() {
}
Channel *DrivenEngine::get_chid(int chid) const {
assert(chid != 0);
assert(unsigned(chid) < DRV_MAX_CHAN);
assert(channels_[chid].get() != nullptr);
return channels_[chid].get();
@@ -160,10 +163,6 @@ SharedChannel DrivenEngine::new_incoming_channel() {
}
}
SharedChannel DrivenEngine::get_stdio_channel() {
return stdio_channel_;
}
void DrivenEngine::set_visible_world_and_actor(World *w, int64_t id) {
visible_world_ = w;
visible_actor_id_ = id;
@@ -180,8 +179,6 @@ void DrivenEngine::stop_driver() {
DrivenEngine::DrivenEngine() {
next_unused_chid_ = 1;
stdio_channel_ = eng::make_shared<Channel>(this, 0, 0, "", false);
channels_[0] = stdio_channel_;
rescan_lua_source_ = false;
clock_ = 0.0;
have_prints_ = false;