Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » standard function sources

Credits go to ReyBrujo and X-G for helping out!
This thread is locked; no one can reply to it. rss feed Print
standard function sources
Kris Allen
Member #4,639
May 2004
avatar

Hi,

I'm a bit curious as to how bread-and-butter functions like memcpy, strcmp, memset, etc, work... are there sources available anywhere, either in C/C++ or assembly? I've just been writing my own functions to do these jobs (no particular reason, just to see if I could), but they're nowhere near as fast as the pre-made ones.

Thanks!

- Kris

ReyBrujo
Moderator
January 2001
avatar

It depends on the compiler. You can try downloading the standard GCC library source code and check the functions out. Just check the source of MinGW or DJGPP to get your answers :)

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

X-G
Member #856
December 2000
avatar

Glibc source code should be available, probably from gnu.org...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Kris Allen
Member #4,639
May 2004
avatar

I'll try both of those, thanks

- Kris

gillius
Member #119
April 2000

The standard libraries for C and C++ come in source code form for MSVC as well as GCC. I don't know about other compilers. The GCC standard library is licensed by LGPL, and MSVC's code is obviously not open source -- but you are free to examine it.

Gillius
Gillius's Programming -- https://gillius.org/

Go to: