3468 views|9 replies

7815

Posts

57

Resources
The OP
 

[Fun things in the C standard library] glibc implementation of strlen [Copy link]

This post was last edited by Xin Xin on 2017-12-7 01:00 Source insight is a paid service after all. It is indeed useful, but sometimes I can't find a completely cracked version, and it is really annoying to be reminded once every 30 days. In addition, my company's computer cannot upload code normally, so online tools have become my first choice. I have already chosen an online C/C++ compiler before, and that compiler is simple enough. Now I will choose another online editor to view code. In particular, the corresponding post to be viewed is glibc's strlen.c As usual, since it is a company computer, I can't upload the code - next time I go home, I will slowly tinker with it and then post the source code. Now, I will post a few pictures to let everyone feel it. A small strlen has many tricks. It seems that writing a C standard library is really not a fun thing. First of all, I recommend you to use SourceInsight. I guess everyone likes to use such a famous tool. First, search for the implementation of strlen. I was intimidated by this. 5 implementations, 3 functions, and 2 macro definitions. However, after a closer look, there is a name with i386, which means it is probably related to the machine type. I am a little relieved. Although I still look at it carefully, but, have you noticed that it seems that none of them are similar to our implementation? There are always some strange and unfamiliar function calls.
This post is from Programming Basics

Latest reply

Xin Xin, you didn't say anything.  Details Published on 2017-12-6 15:37
Personal signature

强者为尊,弱者,死无葬身之地

 

7815

Posts

57

Resources
2
 
Frankly speaking, I didn't understand any of it. There are also some grammatical blind spots in it, which I believe most people don't encounter normally. ——In the past, I have always wondered how to read a code or a library seriously. If Linux is too large and too far away from us, then perhaps reading an open source implementation of the C standard library is the most meaningful. However, I didn't know where to start at the time. Now, I found that I was suddenly very interested in strlen, so I thought that maybe in this way, starting with one or two functions, I might be able to make a breakthrough in reading the C standard library little by little. Stay tuned.
This post is from Programming Basics
 
Personal signature

强者为尊,弱者,死无葬身之地

 
 

9721

Posts

24

Resources
3
 
Playing at such a low level
This post is from Programming Basics
 
 
 

855

Posts

5

Resources
4
 
Can the leader not dig a hole? If you have dug one, fill it up quickly, otherwise you will be beaten
This post is from Programming Basics
 
Personal signature作为一个菜逼,干货并没有多少。唯一会的就是水,所以回帖水分大。望见谅!
 
 

10

Posts

1

Resources
5
 
Awesome, I don't know how awesome it is. Let's code it and see
This post is from Programming Basics
 
 
 

7815

Posts

57

Resources
6
 
The Fantasy of RMB was published on 2017-11-2 09:08 Can the leader not dig a hole? If you have dug it, fill it up quickly, otherwise you will be beaten
Isn’t this starting to fill it up?......
This post is from Programming Basics
 
Personal signature

强者为尊,弱者,死无葬身之地

 
 

406

Posts

1

Resources
7
 
The writing style inside is somewhat unconventional
This post is from Programming Basics
 
 
 

1w

Posts

203

Resources
8
 
Xin Xin, you didn't say anything.
This post is from Programming Basics
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 

7815

Posts

57

Resources
9
 
okhxyyo posted on 2017-12-6 15:37 Xin Xin, you didn't say anything
I forgot to update for a long time, Sao Rui
This post is from Programming Basics
 
Personal signature

强者为尊,弱者,死无葬身之地

 
 

7815

Posts

57

Resources
10
 
okhxyyo posted on 2017-12-6 15:37 Xin Xin, you didn't say anything
Since you mentioned it, let's start from here.
This post is from Programming Basics
 
Personal signature

强者为尊,弱者,死无葬身之地

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list