应用 waPC (rust) 做软件测试工具#[no_mangle] pub fn wapc_init() { wapc::register_function("ping", ping); } fn ping(msg: &[u8]) -> wapc::CallResult { …. Ok(msg.to_vec()) } waPC Guest Rust waPC • Use wapc_init to register function only be used inside WAPC_init • Register_function cannot be called inside ping • _start is meant to support tinygo’s wasm • waPC host will still run both "wapc_init" and "_start" during intialization intialization waPC Guest Rust waPC • Use wapc_init to register function • _start also can • Util Lib uses wapc_init, users build on top of ”_start” extern crate wapc_guest as guest; extern crate0 码力 | 30 页 | 2.50 MB | 1 年前3
Bringing Existing Code to CUDA Using constexpr and std::pmrstd::pmr::vectory(N, &mem); // … Device Only Memory Allocation 27 |template struct no_init_allocator : std::pmr::polymorphic_allocator { // constructors template void }; template using vector = std::vector init_allocator >; A Non-Initialising Allocator 28 |template struct no_init_allocator : std::pmr::polymorphic_allocator { // ::new (static_cast (p)) U; } }; template using vector = std::vector init_allocator >; A Non-Initialising Allocator 29 |device_memory_resource mem; vector x(N 0 码力 | 51 页 | 3.68 MB | 6 月前3
sync clickhouse with mysql mongodbkey Our Solution: PTS Key Features ● Only one config file needed for a new Clickhouse table ● Init and keep syncing data in one app for a table ● Sync multiple data source to Clickhouse in minutes Engine temp table) Final Product ● Only one config file needed for a new Clickhouse table ● Init and keep syncing data in one app for a table ● Sync multiple data source to Clickhouse in minutes0 码力 | 38 页 | 2.25 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - Zeno 中的现代 C++ 最佳实践 该类的构造函数一定在 main 之前执行 • 2. 该类的解构函数一定在 main 之后执行 • 该技巧可用于在程序退出时删除某些文件之类 。 • 这就是小彭老师的静态初始化 (static-init) 大法 。 静态初始化用于批量注册函数 • 我们可以定义一个全局的函数表(右图中的 functab ),然后利用小彭老师的静态初始化 大法,把这些函数在 main 之前就插入到全局 main 退出时也不会调用解构函数。 • 并且即使多个线程同时调用了 func ,这个变量的 初始化依然保证是原子的( C++11 起)。 • 这就是函数静态初始化 (func-static-init) 大法。 函数静态初始化可用于“懒汉单例模式” • 如右图。 • getMyClassInstance() 会在第一次调用时创 建 MyClass 对象,并返回指向他的引用。 • 根据0 码力 | 54 页 | 3.94 MB | 1 年前3
Go读书会第二期gopher 编写 Go 代码都会用到的 • Go 包导入相关 • 代码块与作用域 • 控制语句的惯用法与坑 Part4 – 语法基础:函数与方法 践行哲学,遵循惯例,认清本质,理解原理 • Init 函数 • 成为“一等公民” • defer 的惯用法与坑 • 变长参数函数妙用 • 方法的本质、 receiver 参数类型选择、方法集 合 Go 程序逻辑的基本承载单元 Part50 码力 | 26 页 | 4.55 MB | 1 年前3
Await-Tree Async Rust 可观测性的灵丹妙药 - 赵梓淇Async Rust 的设计与痛点 1 Await-Tree 的 应用与真实案例 3 设计目标 Await Tree 的设计原理与实现 • 追踪关键 Future 的生命周期和控制流 • Init, First Poll, Pending, Next Poll, Ready, Cancel • 实时将 Task 的执行状态维护为一棵树 • 显示目前正在阻塞 / 执行的 Await Point0 码力 | 37 页 | 8.60 MB | 1 年前3
基于Rust-vmm实现Kubernetes运行时files. For example, containerd-shim/busybox/docker-runc , /usr/bin/docker-runc /bin/bash /bad_init /proc/self/fd/ 4. Linux Kernel Patch Are those enough? NO https://landscape.cncf.io/category0 码力 | 27 页 | 34.17 MB | 1 年前3
C++20: An (Almost) Complete Overviewargs...] { // ✔ return std::invoke(f, args...); }; } An init-capture followed by an ellipsis is ill-formed: templateauto delay_invoke(F 0 码力 | 85 页 | 512.18 KB | 6 月前3
共 8 条
- 1













