Commit ea4d381f authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Remove resetting of TProcessID::ObjectCount when reading in events

This should be not necessary according to https://root-forum.cern.ch/t/memory-re-allocation-bottleneck-with-tprocessid/53304

This reverts commit 801970778946f491445d74923d44446e57200173.
parent 6e12b1d7
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -121,10 +121,6 @@ for(auto& object : objects) {
}
```

Since `TRef` object IDs are reused and counted up only on a per-event basis to keep the size of the central reference table 
under control, the ROOT-internal object count has to be reset also after *reading* an entire event from file and before 
proceeding with the next one. Otherwise the reused IDs from the previous event will still remain in the reference table, but 
pointing to invalid memory locations or to objects from the previous event.



+0 −7
Original line number Diff line number Diff line
@@ -268,9 +268,6 @@ void ROOTObjectReaderModule::initialize() {
void ROOTObjectReaderModule::run(Event* event) {
    auto root_lock = root_process_lock();

    // Retrieve current object count:
    auto object_count = TProcessID::GetObjectCount();

    // Beware: ROOT uses signed entry counters for its trees
    auto event_num = static_cast<int64_t>(event->number);
    --event_num;
@@ -325,10 +322,6 @@ void ROOTObjectReaderModule::run(Event* event) {
        // Reset the message pointer:
        message_inf.message.reset();
    }

    // Reset the TObject count after reading in this event because the TRef counting will start over again from the beginning
    // in the next event.
    TProcessID::SetObjectCount(object_count);
}

void ROOTObjectReaderModule::finalize() {