HNHacker News
TopNewBestAskShowJobs

blue11

169 karma · joined October 1, 2013

submissionscomments
blue11··on Instagrams from North Korea
Everything looks like Eastern Europe in the 80s, except that, as many people noted already, nobody is smiling.
blue11··on Memory – Part 4: Intersec’s custom allocators
Well, that much is obvious. But if you are going to truncate, you should be consistent. Always truncate towards 0, not sometimes towards 0 and sometimes towards infinity.
blue11··on Memory – Part 4: Intersec’s custom allocators
Sorry to nitpick, but I believe the time difference code has an error of 1 millisecond 25% of the time:

    int64_t delta = tv2->tv_sec - tv1->tv_sec;
    return delta * 1000 + (tv2->tv_usec - tv1->tv_usec) / 1000;
One way to fix it is:

    int64_t deltasec = tv2->tv_sec - tv1->tv_sec - 1;
    int64_t deltausec = tv2->tv_usec - tv1->tv_usec + 1000000;
    return deltasec * 1000 + deltausec / 1000;
← PreviousPage 3 of 3