HackerTrans
TopNewTrendsCommentsPastAskShowJobs

cross

no profile record

comments

cross
·2 เดือนที่ผ่านมา·discuss
Xoogler here. This hits hard; right on the kidney.

That is a huge problem at Google: "we're google; we know what you want and need better than you do." That and an unshakable confidence in their own infallibility.

When I was there, I remember saying, "we do some cool stuff, but always remember that hubris is the death of empires."
cross
·ปีที่แล้ว·discuss
We don't. When I'm there, I see it addressed as a communal responsibility. Not to be facetious, but the way it's done is a bit of a microcosm of Oxide itself: everyone just chips in and does parts of it as needed. I even filed a ticket to get a push-broom last time to make sweeping the floor easier.
cross
·ปีที่แล้ว·discuss
Linux won in large part because it was in the right place, at the right time: freely available, and rapidly improving in functionality and utility, and it ran on hardware people had access to at home.

BSD was mired in legal issues, the commercial Unix vendors were by and large determined to stay proprietary (only Solaris made a go of this and by that time it was years too late), and things like Hurd were bogged down in second-system perfectionism.

Had Linux started, maybe, 9 months later BSD may have won instead. Had Larry McVoy's "sourceware" proposal for SunOS been adopted by Sun, perhaps it would have won out. Of course, all of this is impossible to predict. But, by the time BSD (for example) was out of the lawsuit woods, Linux had gained a foothold and the adoption gap was impossible to overcome.

At the end of the day, I think technical details had very little to do with it.
cross
·2 ปีที่แล้ว·discuss
The first attempt appears to try and transfer ownership of the allocated memory from the Vec to C, so my first question is, why not allocate the returned memory using libc::malloc?

But I do recognize that the code in the post was a simplified example, and it's possible that the flexibility of `Vec` is actually used; perhaps elements are pushed into the `Vec` dynamically or something, and it would be inconvenient to simulate that with `libc::malloc` et al. But even then, in an environment that's not inherently memory starved, a viable approach might be to build up the data in a `Vec`, and then allocate a properly-sized region using `libc::malloc` and copy the data into it.

Another option might be to maintain something like a BTreeMap indexed by pointer on the Rust side, keeping track of the capacity there so it can be recovered on free.
cross
·2 ปีที่แล้ว·discuss
> If you've been doing C for five decades, it's a shame not to have noticed that it's totally fine to pass a NULL pointer to free().

Or that calling one's FFI function inside of an `assert` means it will be compiled out if the `NDEBUG` macro is defined.
cross
·2 ปีที่แล้ว·discuss
I'm not Bryan, obviously, but part of the answer here is that 100 servers running at 100% capacity is an absolute upper bound, but most of the time you're nowhere near that. Most of the time few things are at full capacity, which means that you can multiplex your physical hardware resources to increase utilization efficiency.