Hacker GitHub

← All repos

lattera/glibc

View on GitHub ↗ ★ 1,968 C archived

GNU Libc - Extremely old repo used for research purposes years ago. Please do not rely on this repo.

27 mentions on Hacker News by 27 people: 1 story, 26 comments · first 2015-02-12 · latest 2026-03-12

Mentions per year 27 mentions · busiest year 2017 (5)
20082026
  1. …implementation already has tests for several ranges and hacks for them including Taylor series: https://github.com/lattera/glibc/blob/master/sysdeps/ieee754... The smallest range is |x| < 1.49011611938477e-8. In this case the routine just…
    comment by kazinator · 2026-03-12 · in Faster asin() was hiding in plain sight
  2. Yeah look at even strlen() https://github.com/lattera/glibc/blob/master/string/strlen.c
  3. Look at glibc. eg: https://github.com/lattera/glibc/blob/master/string/strcpy.c
  4. …behavior, and they don't require implementations to define any particular behavior either. [1]: https://github.com/lattera/glibc/blob/master/string/memcpy.c [2]: https://github.com/lattera/glibc/blob/895ef79e04a953cac14938...
    comment by ryukoposting · 2024-12-11 · in Making memcpy(NULL, NULL, 0) well-defined
  5. I was surprised to find log implementations are loopless. Cool. https://github.com/lattera/glibc/blob/master/sysdeps/ieee754...
  6. …that the syscall is only performed if waiters are detected in userspace during an unlock operation https://github.com/lattera/glibc/blob/master/nptl/pthread_mu...
  7. …it to do so, and https://stackoverflow.com/a/6743056 claims glibc did that in 2011. Looking at https://github.com/lattera/glibc/blob/895ef79e04a953cac14938... and https://github.com/lattera/glibc/blob/895ef79e04a953cac14938... , it seems…
    comment by Someone · 2023-05-04 · in Error Handling Patterns
  8. most commonly they are typically used in the definition of the assert macro. For example: https://github.com/lattera/glibc/blob/master/assert/assert.h .
    comment by gpderetta · 2022-07-14 · in The Preprocessor Iceberg Meme
  9. …how conversion to string works, so handrolling an algorithm would likely be around the same speed. https://github.com/lattera/glibc/blob/master/stdio-common/_i... It's all bit-shifts, bit-masks and a lot of other hacks to get the maximum…
  10. …negative integer for some undefined behavior as well (shift by negative value occurs here [1]) [1] https://github.com/lattera/glibc/blob/895ef79e04a953cac14938...
    comment by guidovranken · 2021-09-30 · in Fun with Glibc and the Ctype.h Functions
  11. …mathematical pi [3]. [0]: https://randomascii.wordpress.com/2014/10/09/intel-underesti... [1]: https://github.com/lattera/glibc/blob/master/sysdeps/ieee754... [2]: https://github.com/lattera/glibc/blob/master/sysdeps/ieee754... [3]:…
    comment by MauranKilom · 2021-08-17 · in Speeding up atan2f
  12. en-dk has ISO 8601 though you're right it uses the comma. https://github.com/lattera/glibc/blob/master/localedata/loca...
    comment by akvadrako · 2021-02-26 · in ISO 8601: a better date format
  13. …so I need to loop back to check again. The atomic CAS operation is the one acquiring the lock. [1] https://github.com/lattera/glibc/blob/master/nptl/pthread_mu... Edit: the atomic_compare_and_swap can be just a macro to the assembly…
    comment by ww520 · 2020-01-04 · in Mutexes are faster than Spinlocks
  14. …runtime) you will be pretty much 99% of the way there. https://en.cppreference.com/w/c/string/byte https://github.com/lattera/glibc/tree/master/string
  15. …“fmaf” for an architecture that doesn't have it has the same problem, and the solution looks like: https://github.com/lattera/glibc/blob/b4d5b8b02133e0c317e6c8... “round-to-odd” is not a standardized rounding mode, even though it is so…
  16. …memory (unless you want to operate on statically defined memory buffer) but well it's still C. [0] https://github.com/lattera/glibc/blob/master/malloc/malloc.c
  17. …and CHECK_BOUNDS_HIGH, which get defined about here [1]. Am I missing something? [0] https://github.com/lattera/glibc/blob/master/string/strcpy.c [1] https://github.com/lattera/glibc/blob/master/sysdeps/generic...
  18. The problem is glibc: https://github.com/lattera/glibc/blob/master/stdlib/exit.c And by extension, the rather complex set of POSIX exit() semantics: http://pubs.opengroup.org/onlinepubs/000095399/functions/exi... Using something like musl…
    comment by tadfisher · 2017-08-18 · in X: The First Fully Modular Software Disaster
  19. Yeah I got a surprise when I wanted to see how strlen was implemented: https://github.com/lattera/glibc/blob/master/string/strlen.c
    comment by scandox · 2017-06-13 · in How is GNU `yes` so fast?
  20. …can predict what Parliament will do, you should be in # politics making a fortune, not computing. https://github.com/lattera/glibc/blob/master/timezone/europe
  21. …SIGABRT can be caught. Indeed, that's one of the methods used by the abort() function to stop: https://github.com/lattera/glibc/blob/master/stdlib/abort.c
  22. …I suppose this is faster because accessing data with the proper cpu alignment is faster. 0: https://github.com/lattera/glibc/blob/master/string/memcpy.c...
  23. …found no such benchmark anywhere. And writing such a test isn't hard, not in the slightest. [0] https://github.com/lattera/glibc/blob/master/sysdeps/x86_64/...
  24. …completely misleading, since sprintf_chk is going to be several hundred instructions itself. Follow https://github.com/lattera/glibc/blob/master/debug/sprintf_c... all the way down the rabbit hole :)
    comment by DannyBee · 2016-05-13 · in Giving up on Julia
  25. …even looks likely that this specific bug is still exploitable under your proposal. Here is the bug: https://github.com/lattera/glibc/blob/a2f34833b1042d5d8eeb26... The buffer overflow occurs here: https://github.com/lattera/glibc/blob/a2f34…
  26. …in a 1983 BSD libc says little about current rand() implementations! These look ok, for example: https://github.com/lattera/glibc/blob/master/stdlib/random_r... https://www.opensource.apple.com/source/Libc/Libc-320/stdlib... Of course it's…
    comment by fulafel · 2015-02-12 · in The bell has tolled for rand()