Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request.depart set to 0 when created #89

Open
hanm2019 opened this issue Nov 22, 2020 · 2 comments
Open

request.depart set to 0 when created #89

hanm2019 opened this issue Nov 22, 2020 · 2 comments

Comments

@hanm2019
Copy link

I found the parameter depart in Request.h is not init to any value. I think it may cause some problem when a WRITE request send to the Memory and in the callback function, the request.depart is a random value, since this parameter hasn't been set to any value. Maybe set this value to 0 at the init time is better.

@arthasSin
Copy link
Member

Request.depart is only used for READ requests and depart is set right before a READ req is inserted into the pending queue. So, having depart uninitialized when creating a Request object shouldn't cause a problem but it is a good practice to set initial values for all member variables of course. Thanks for the feedback

@hanm2019
Copy link
Author

hanm2019 commented Nov 23, 2020

since the issue40, the WRITE req also call the callback, so if the callback function don't make sure the operation type is READ, and do r.depart - r.arrive directly, it may cause some problem.

in the Main.cpp run_dramtrace()

auto read_complete = [&latencies](Request& r){latencies[r.depart - r.arrive]++;};

maybe get a wrong result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants