当前位置:网站首页>【精通高并发】深入理解C语言基础与汇编下的C语言
【精通高并发】深入理解C语言基础与汇编下的C语言
2022-06-25 15:57:00 【华为云】
作者简介:小明的Java问道之路,某大型金融互联网公司后端研发高级工程师,擅长订单/交易领域的高安全/可用/并发/性能的架构设计与落地,专注于研究计算机底层与金融科技领域技术
如果此文还不错的话,还请关注、点赞、收藏三连支持一下博主
本文导读:C语言基础部分不过多赘述,主要讲解结构体、指针和数组原理,并分析汇编下的C语言。Liunx内核和JNI都是通过C编写,这部分主要讲解通过操作指针和内存执行程序的思想,对后续Hotspot和java的api的理解有很重要的作用。
二、C语言基础
1.结构体应用
必须使用struct语句,struct语句定义了一个包含多个成员的数据类型
2.从汇编的角度看结构体
从此段简单的代码分析,name和age地址相差8个字节,整好是一个整形4个字节+4个字节填充,我们将其反汇编,看下汇编代码的实现。
每个变量都会有一个内存地址,每个内存地址都可以使用&访问,他表示在内存中的地址。首先明确一个概念,指针就是一个变量,其值就是另一个变量的地址(内存位置的直接地址),所有使用的时候必须先声明。
将上述代码反汇编之后的代码,作者为64位系统
5.一些指针的基础应用
通过指针访问数组,数组是连续的空间,指针中保存的是对应数据的地址,声明数组的时候就是默认新开辟连续的地址空间的第一个元素的地址,使用var[index] 等价于我们直接操作指针 * 引用获取元素;
指针数组就是保存元素地址(指针)的数组
边栏推荐
- ES6 deconstruction assignment rename
- Uniapp converts graphic verification codes in the form of file streams into images
- Error: homebrew core is a shallow clone
- Lifeifei's team applied vit to the robot, increased the maximum speed of planning reasoning by 512 times, and also cued hekaiming's MAE
- User registration, information writing to file
- 普通人的2022春招总结(阿里、腾讯offer)
- Hash table, generic
- One minute to familiarize yourself with the meaning of all fluent question marks
- Introduction to MgO 256gb NAND flash chip
- Servlet详解
猜你喜欢

Multiple decorators decorate a function

Overall MySQL architecture and statement execution process

Day_ 05

Xinlou: un voyage de sept ans de Huawei Sports Health

Educational administration system development (php+mysql)
![[100 questions of Blue Bridge Cup intensive training] scratch command mobile Blue Bridge Cup scratch competition special prediction programming question intensive training simulation exercise question](/img/45/9955c9a5edeaa681f3fa8ce4041bfe.png)
[100 questions of Blue Bridge Cup intensive training] scratch command mobile Blue Bridge Cup scratch competition special prediction programming question intensive training simulation exercise question

Alvaria announces Jeff cotten, a veteran of the customer experience industry, as its new CEO

Read mysql45 lecture - index

cmd。。。。。。

Beginner bug set
随机推荐
When inputting text in the shutter textfield, if the page is refreshed, the cursor position will change.
Day_ seventeen
Educational administration system development (php+mysql)
What exactly is a handler
Activation and value transfer of activity
Shuttle pop-up returns to the upper level
error Parsing error: Unexpected reserved word ‘await‘.
What are some tricks that novice programmers don't know?
Deadlock, thread communication, singleton mode
有哪些新手程序员不知道的小技巧?
Message format of Modbus (PLC)
cmd。。。。。。
Cocoapods installation in 2021
Lifeifei's team applied vit to the robot, increased the maximum speed of planning reasoning by 512 times, and also cued hekaiming's MAE
Common APIs and exception mechanisms
WPF开发随笔收录-心电图曲线绘制
1-8Vmware中的文件共享
About the use of Aidl, complex data transmission
IO stream
论文笔记:Generalized Random Forests