glibc
vscode-gradle
glibc | vscode-gradle | |
---|---|---|
47 | 2 | |
1,585 | 146 | |
4.0% | 8.9% | |
9.9 | 8.3 | |
4 days ago | 23 days ago | |
C | Java | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
glibc
-
C stdlib isn't threadsafe and even safe Rust didn't save us
I'll take existence proofs [1] over personal insults but YMMV.
[1] https://github.com/bminor/glibc/commit/7a61e7f557a97ab597d6f...
-
Don't Clobber the Frame Pointer
Depending on how you count, the ratio might not be that small. A lot of hot code are written in hand-coded inline assembly, so in terms of CPU cycles run it's probably non-negligible.
i.e. take a look at the glibc implementation of 'strcmp` [0]
[0] https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m...
- I cut GTA Online loading times by 70% (2021)
-
Cray-1 performance vs. modern CPUs
I wonder if you’re using a different definition of ‘vectorized’ from the one I would use. For example glibc provides a vectorized strlen. Here is the sse version: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m...
It’s pretty simple to imagine how to write an unoptimized version: read a vector from the start of the string, compare it to 0, convert that to a bitvector, test for equal to zero, then loop or clz and finish.
I would call this vectorized because it operates on 16 bytes (sse) at a time.
There are a few issues:
1. You’re still spending a lot of time in the scalar code checking loop conditions.
2. You’re doing unaligned reads which are slower on old processors
3. You may read across a cache line forcing you to pull a second line into cache even if the string ends before then.
4. You may read across a page boundary which could cause a segfault if the next page is not accessible
So the fixes are to do 64-byte (ie cache line) aligned accesses which also means page-aligned (so you won’t read from a page until you know the string doesn’t end in the previous page). That deals with alignment problems. You read four vector registers at a time but this doesn’t really cost much more if the string is shorter as it all comes from one cache line. Another trick in the linked code is that it first finds the cache line by reading the first 16 bytes then merging in the next 3 groups with unsigned-min, so it only requires one test against a zero vector instead of 4. Then it finds the zero in the cache line. You need to do a bit of work in the first iteration to become aligned. With AVX, you can use mask registers on reads to handle that first step instead.
-
Setenv Is Not Thread Safe and C Doesn't Want to Fix It
That was also my thought. To my knowledge `/etc/localtime` is the creation of Arthur David Olson, the founder of the tz database (now maintained by IANA), but his code never read `/etc/localtime` multiple times unless `TZ` environment variable was changed. Tzcode made into glibc but Ulrich Drepper changed it to not cache `/etc/localtime` when `TZ` is unset [1]; I wasn't able to locate the exact rationale, given that the commit was very ancient (1996-12) and no mailing list archive is available for this time period.
[1] https://github.com/bminor/glibc/commit/68dbb3a69e78e24a778c6...
-
CTF Writeup: Abusing select() to factor RSA
That's not really what the problem is. The actual code is fine.
The issue is that the definition of `fd_set` has a constant size [1]. If you allocate the memory yourself, the select() system call will work with as many file descriptors as you care to pass to it. You can see that both glibc [2] and the kernel [3] support arbitrarily large arrays.
[1] https://github.com/bminor/glibc/blob/master/misc/sys/select....
[2] https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys...
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
-
How are threads created in Linux x86_64
The source code for that is here.
-
Using Uninitialized Memory for Fun and Profit (2008)
Expanding macro gives three GCC function attributes [2]: `__attribute__ ((malloc))`, `__attribute__ ((alloc_size(1)))` and `__attribute__ ((warn_unused_result))`. They are required for GCC (and others recognizing them) to actually ensure that they behave as the standard dictates. Your own malloc-like functions won't be treated same unless you give similar attributes.
[1] https://github.com/bminor/glibc/blob/807690610916df8aef17cd1...
[2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...
-
“csinc”, the AArch64 instruction you didn’t know you wanted
IFunc relocations is what enables glibc to dynamically choose the best memcpy routine to use at runtime based on the CPU.
see https://github.com/bminor/glibc/blob/glibc-2.31/sysdeps/x86_...
-
memmove() implementation in strictly conforming C -- possible?
memmove can be very well implemented in pure C, libc implementations usually have a "generic" (meaning, architecture independent) fallback. Here is musl generic implementation and its x86-64 assembly implementation. For glibc, implementation is a bit more complex, having multiple architectures implemented, but you could find a generic implementation with these two files: memmove.c and generic/memcopy.h.
vscode-gradle
-
Tell HN: Microsoft forks MIT licensed repo, and changes the copyright to them
Seems like a mistake to me. Microsoft recently adopted one of my Open Source projects and part of the agreement was they would keep the original license. This was a request on their part, I had no choice in the matter. They know what they're doing, I don't think they would do this deliberately. (Licence here: https://github.com/microsoft/vscode-gradle/blob/main/LICENSE...)
-
Node + gRPC
I've used gRPC in a VS Code extension (node.js), here's a basic architecture overview: https://github.com/badsyntax/vscode-gradle/blob/master/ARCHITECTURE.md
What are some alternatives?
musl - Unofficial mirror of etalabs musl repository. Updated daily.
vscode-spotless-gradle - A VS Code extension to lint & format your source files using Spotless & Gradle.
cosmopolitan - build-once run-anywhere c library
grpc-js-types - Generate gRPC TypeScript definitions for use with gRPC (@grpc/grpc-js).
wepoll - wepoll: fast epoll for windows 🎭
health-cards-tests - Fork to provide additional tests on SMART Health Cards Framework