[gem5-users] Re: Use of std::ostream in OutputStream class

2022-02-10 Thread Gabriel Busnot via gem5-users
Hi Scott, This is regular use of polymorphism through virtual member functions : you **dynamically** allocate whatever subclass of std::ostream (e.g., std::ofstream) and you store the returned pointer value into a pointer to base class (std::ostream*). When deleting this pointer, independently

[gem5-users] Use of std::ostream in OutputStream class

2022-02-10 Thread Scott Blankenberg via gem5-users
Hello all, I have a question about the _stream variable of the OutputStream class(base/output.hh, base/output.cc) I had a question about the variable definition. std::ostream *const _stream; Why do we use std::ostream vs std::ofstream? The reason I am asking is because I cannot seem to find

[gem5-users] Re: findOrCreate function

2022-02-10 Thread Scott Blankenberg via gem5-users
Hello Jason, Following the example in the elastic trace code seems to work for me. Thanks ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Destructor for BaseCPU

2022-02-10 Thread Gabriel Busnot via gem5-users
Hi, If I remember correctly, SimObjects are never destructed, although they have a virtual destructor. The memory is reclaimed by the OS at process exit. Thus, I would also recommend not using the destructor and prefer registerExitCallback(). Gabriel