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
20082026
-
…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 -
Yeah look at even strlen() https://github.com/lattera/glibc/blob/master/string/strlen.c
comment by ape4 · 2025-05-11 · in Comparison of C/POSIX standard library implementations for Linux -
Look at glibc. eg: https://github.com/lattera/glibc/blob/master/string/strcpy.c
comment by trollied · 2025-04-21 · in Show HN: I rewrote few of the common core string.h functions -
…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 -
▲ 4
`Strlen` in Glibcstory by c4pt0r · 2023-10-24 · 2 comments
-
I was surprised to find log implementations are loopless. Cool. https://github.com/lattera/glibc/blob/master/sysdeps/ieee754...
comment by seeknotfind · 2023-09-27 · in The most copied StackOverflow snippet of all time is flawed (2019) -
…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...
comment by m4nu3l · 2023-05-10 · in A collection of lock-free data structures written in standard C++11 -
…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 -
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 -
…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…
comment by kongin · 2021-10-08 · in Google’s recruiting system is famously brutal. Many workers think it’s failing -
…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 -
…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 -
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 -
…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 -
…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
comment by s_m_t · 2019-04-24 · in An Introduction to C and GUI Programming -
…“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…
comment by pascal_cuoq · 2019-03-21 · in Exercises in Emulation: Xbox 360’s FMA Instruction -
…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
comment by mbel · 2018-07-25 · in Pointers Are Complicated, or What’s in a Byte? -
…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...
comment by shakna · 2018-07-22 · in Conflating pointers with arrays: C's biggest mistake? (2009) -
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 -
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? -
…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
comment by microtherion · 2017-05-06 · in The Patek Philippe Caliber 89 and Horology’s Easter Problem -
…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
comment by pif · 2017-04-27 · in Linux Programming: Signals the easy way -
…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...
comment by roblabla · 2017-04-04 · in Gameboy Advance Development by Example: Drawing and Moving Sprites -
…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/...
comment by gens · 2016-10-15 · in Intel will add deep-learning instructions to its processors -
…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 -
…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…
comment by pcwalton · 2016-02-17 · in Glibc getaddrinfo stack-based buffer overflow -
…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()