07 2022 档案

Java File I/O 操作
摘要:一、实验Demo 1. UTF_8格式读写文件节点 import java.io.*; import static java.nio.charset.StandardCharsets.UTF_8; public class FileIo { static final String TAG = "Fi 阅读全文

posted @ 2022-07-25 16:22 Hello-World3 阅读(57) 评论(0) 推荐(0) 编辑

Linux内核机制—percpu
摘要:一、per-cpu变量简介 在多处理器系统中,每处理器变量为每个cpu都生成一个变量的副本,每个处理器使用自己的副本,从而避免了处理器之间的互斥和同步,提高了程序的执行速度。每处理器变量分为静态per-cpu变量和动态per-cpu变量。 二、静态per-cpu变量 1. 静态per-cpu变量使用 阅读全文

posted @ 2022-07-23 21:00 Hello-World3 阅读(1477) 评论(0) 推荐(0) 编辑

HIDL学习笔记_4——使用总结
摘要:1. 在修改.hal文件时需要同时更新current.txt文件中的hash,触发hash更新的方法如下 //若对下面文件产生hash: source/vendor/mom/hardware/interface/performance/1.0/IPerformance.hal package ven 阅读全文

posted @ 2022-07-19 14:25 Hello-World3 阅读(347) 评论(0) 推荐(0) 编辑

kptr_restrict 内核文件简介
摘要:一、简介 系统为了保护内核符号地址不被泄露, 而用的一种保护手段, 从而使除 root 用户外的普通用户不能直接查看符号地址。原因在于内核文件 kallsyms.c 中的显示符号地址命令中做了如下限制: seq_printf(m, "%pK %c %s\n", (void *)iter->value 阅读全文

posted @ 2022-07-11 21:28 Hello-World3 阅读(1511) 评论(0) 推荐(0) 编辑

Binder学习笔记1—Service示例分析
摘要:一、示例一:SystemSuspend对binder使用 1. 示例代码 //vnd/system/hardware/interfaces/suspend/1.0/default/main.cpp #include <binder/IPCThreadState.h> #include <binder 阅读全文

posted @ 2022-07-10 21:31 Hello-World3 阅读(1237) 评论(0) 推荐(0) 编辑

C++经典案例
摘要:1. per-thread的单例模式 //单例子模式,per-thread的单例模式 IPCThreadState* IPCThreadState::self() //IPCThreadState.cpp { if (gHaveTLS.load(std::memory_order_acquire)) 阅读全文

posted @ 2022-07-10 16:08 Hello-World3 阅读(630) 评论(0) 推荐(0) 编辑

Linux内核中各种鉴权
摘要:一、编译阶段 1. BUILD_BUG 系列 主要定义在 include/linux/build_bug.h 文件中,若编译期发现不合法就报错并中止编译。 (1) BUILD_BUG_ON(condition) #define BUILD_BUG_ON(condition) BUILD_BUG_ON 阅读全文

posted @ 2022-07-09 17:19 Hello-World3 阅读(990) 评论(0) 推荐(0) 编辑

C++ std::ofstream 和 std::ifstream 和 文件操作
摘要:1. 简介 C++中对文件进行读写的。 2. 使用Demo #include <iostream> #include <fstream> #include <string> #include <string.h> using namespace std; static constexpr char 阅读全文

posted @ 2022-07-05 23:39 Hello-World3 阅读(2242) 评论(0) 推荐(0) 编辑

C++匿名函数-Lambda表达式
摘要:一、匿名函数简介 1. 为什么存在匿名函数 使用 STL 时,往往会大量用到函数对象,为此要编写很多函数对象类。有的函数对象类只用来定义了一个对象,而且这个对象也只使用了一次,编写这样的函数对象类就有点浪费。 而且,定义函数对象类的地方和使用函数对象的地方可能相隔较远,看到函数对象,想要查看其 op 阅读全文

posted @ 2022-07-04 23:27 Hello-World3 阅读(816) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示