Rust - 纯Safe双向链表 该代码仅仅提供学习与交流,你要是和我考究性能,你开心就好。 Rust实现 struct Node<T> { data: Box<T>, head: Option<Arc<Mutex<Node<T>>>>, next: Option<Arc<Mutex<Node<T>>>>, 2022-06-06 rust #rust#linkedlist
Linux - syscall (sysdep) #undef INTERNAL_SYSCALL_ERROR_P #define INTERNAL_SYSCALL_ERROR_P(val) \ ((unsigned long int) (val) > -4096UL) #ifndef SYSCALL_ERROR_LABEL # define 2022-06-04 linux #linux#android#syscall#arm64#c++
Rust - 延迟初始化(静态/非静态)变量 lazy_static A macro for declaring lazily evaluated statics. Using this macro, it is possible to have statics that require code to be executed at runti 2022-05-23 rust #lazy_static#rust#test
Linux - 解读aarch64_insn_(read/write/patch_text) 在 AArch64架构(ARM 64位架构)中,以 aarch64_insn_xxx 命名的一系列函数(例如 aarch64_insn_read、aarch64_insn_write、aarch64_i 2022-02-03 linux #linux#kernel#kernel-module#aarch64_insn_xx
Linux - uprobe的使用及检测 uprobe是Linux内核中的一个动态跟踪工具,它允许用户在内核运行时动态地插入探测点(probe points)来收集调试和性能数据。 主要特点: uprobe可以在用户空间程序的任意位置插入探测点,而无需修改或重新编译源代码。 它能够收集函数调用、返回值、参数、局部变量等运行时信息。 对程序性 2022-02-02 linux #uprobe#linux
C - calloc的意义? C里面有malloc和calloc,通常情况下大部分人使用的都是malloc,这两个的作用几乎就是等价的,但是为什么会有calloc这个东西呢? 其实这里面有几个要点: 错误与欺骗 auto m = malloc(INT_MAX * INT_MAX); 上面这个代码显而易见会报错提示说溢出了,而下面 2021-11-21 c++ #c#c++#memory
安卓 - 内核模块读取进程maps #include <linux/module.h> #include <linux/sched.h> /* For task_struct */ #include <linux/pid.h> /* For find_get_pid */ #include <linux/mm.h> /* F 2021-11-07 android #memory#mmap#linux#android#cpp#c++#kernel