Closed a858438680 closed 1 year ago
I've taken a cursory look and it looks awesome. I'm going to do a more thorough review tomorrow when I have some time to fully digest the change.
Can you look at the codacy item it flagged and see if it's a good change?
I've taken a cursory look and it looks awesome. I'm going to do a more thorough review tomorrow when I have some time to fully digest the change.
Can you look at the codacy item it flagged and see if it's a good change?
Of course, I have already looked at it and in the first item, it says that the storage_size
is not used, which is actually not the truth. The storage_size is a constexpr variable and is used as the size of member variable m_storage
. To be truth, I think this is bug of Codacy and someone should create an new issue to tell them. 😂
In the second item, it says that the m_storage
is not initialized, however this is by design, because, I do not want it to be initialized to zero, because this is not necessary and introduces semantic noises. When the task is created, the m_storage
is uninitialized, but the only way to access this m_storage
by the user is to call result()
, however it checks the m_flag
. When it is empty
, the result()
throws an exception. So this m_storage
is safely to be uninitialized.
Agreed, storage_size
is clearly used :sweat_smile: . I'll mark that one as wont fix (assuming I can..).
Agreed on part 2 as well, it doesn't need to be zero initialized when its empty/just created. I'll try and mark it as won't fix as well.
Very nice change, I gave it a proper good look and I'm excited and glad you pushed this PR, its a great addition to making the task class footprint smaller. Thank you.
Please refer to issue #193 .
This pull request does lots of optimization including
coro::task