Viewing profile — btrask
btrask
HN member- Joined
- Thu, Jan 20, 2011, 2:43 AM UTC
- HN karma
- 1,914
- Public activity
- 379 items
- HN profile
- View on Hacker News ↗
About btrask
Recent public activity
-
comment
Comment #29296255
I might be the last person to realize this, but did Microsoft name it .NET because they already had COM?
-
comment
Comment #28943756
This article does not undermine its own point. In fact, very, very few articles ever undermine their own point. In order to undermine your own point it means you've failed to const…
-
comment
Comment #26186441
I didn't like Regehr's proposal because I don't want a friendly dialect of C. I mostly just want C the way it worked up until, say, GCC 4.x. I don't know specifically how to fix th…
-
comment
Comment #26184169
Or... the standard just has bugs which could be fixed. Bugs meaning: being out of line with the history of C and large amounts of C code in the wild. The more people beat the stand…
- story
-
comment
Comment #25526192
Yeah, in C you need to use assertions (or simple checks) for things that might be null. That said the compiler isn't infinitely smart (thank god) and complex null derefs will "safe…
-
comment
Comment #25526115
If you are transferring ownership, you would do p2 = p1; p1 = NULL; However if you are intentionally doing multiple ownership, then yes you can still have problems.
-
comment
Comment #25523684
Green threads.
-
comment
Comment #25523651
I see now, I misunderstood your original post. You were saying async/await is necessary because futures work badly, not because all the alternatives (i.e. locks) work badly. Sorry,…
-
comment
Comment #25523457
Whether it's kernel threads or green threads, the same patterns (locks, etc) are possible. Locks are supposed to be the borrow checker's bread and butter, because it can guarantee …
-
comment
Comment #25523372
Wait, what? What happened to "fearless concurrency"? I thought this was supposed to be one of the borrow checker's selling points! https://blog.rust-lang.org/2015/04/10/Fearless-Co…
-
comment
Comment #25508442
So over the last thousand years salt has been a hyper-inflationary asset, and you're trying to tell me I'm rich for owning some?
-
comment
Comment #25422971
This article is such a great opportunity for introspection ("what do we need in order to do better?"). It's too bad that the top comment has turned it into an opportunity for egoti…
-
comment
Comment #25204268
Very reasonable! Thank you for the discussion :)
-
comment
Comment #25185128
Taking a pointer-to-pointer is intentional to make it clear that the pointer will be modified. That's actually the most important difference from nn3's version IMHO.
-
comment
Comment #25184924
Good points, thank you for explaining! I can see an argument for wrapping it in a macro so you can turn off nulling in debug builds (ASan might even have hooks so you can automate …
-
comment
Comment #25184598
I tried making it a plain function at one point but ran into some weirdness around using void * * with certain arguments (const buffers?). You don't want to accept plain void * bec…
-
comment
Comment #25182721
do {} while(0) is a common idiom for macros in C, because it consumes the trailing semicolon, which a bare {} block doesn't do. if(x) MACRO(); else something(); expands to if(x) { …
-
comment
Comment #25181382
I appreciate you defending me, but I don't think he was trying to be dishonest.
-
comment
Comment #25181319
I don't think that's fair in this case because nulling out pointers isn't the first line of defense. If you forget to do it once, it's not going to cause a bug in and of itself. Yo…
-
comment
Comment #25181232
Help me out here, because I'm really trying to understand. Are you saying that dangling pointers that blow up if you double-free them is an "automatic check"? If not, what kind of …
-
comment
Comment #25180025
In C you can use [0] for postfix pointer dereferencing.
-
comment
Comment #25179563
Here's the actual macro I (sometimes) use: #define FREE(ptrptr) do { \ __typeof__(ptrptr) const __x = (ptrptr); \ free(*__x); *__x = NULL; \ } while(0) There might be a better way …
-
comment
Comment #25179467
Every problem can be solved in many different ways. If you think you've already got use-after-free bugs under control, then more power to you! You absolutely have to concentrate yo…
-
comment
Comment #25179177
All code is full of vulnerabilites. If you say your code isn't, then I'm sure it is. I just do the best I can to keep the error rate as low as possible. But it's a rate, and it's n…