What should happen here?

Kagamin spam at here.lot
Wed Sep 22 21:16:27 UTC 2021


On Wednesday, 22 September 2021 at 20:17:48 UTC, jfondren wrote:
> Neither of these solutions would've helped with the original 
> code that used the epoll API.
>
> The pointer passed to C wasn't important, and it would've been 
> fine for its lifetime to end at the end of the function (it was 
> even a pointer to a stack-allocated struct in the function: 
> epoll copies the struct out of the pointer given to it).
>
> The pointer that mattered was a misaligned class reference in 
> the structure passed to C. This pointer was to an object that 
> will eventually get destructed before the end of its function 
> scope. *That* objected wasn't passed anywhere in its scope, it 
> was initialized and then had a method called on it.

Finally someone tries to solve the real problem. It's beyond me 
why people try to count angels dancing on the tip of a needle.


More information about the Digitalmars-d mailing list