Introduction From a running C program, you can call a Lua script. The C program can pass arguments to the Lua script, and the Lua script can pass back a return. The Lua script can serve to initialize the C program, or the Lua script can install a cal…
Passing Tables to Lua Functions A use case that happens often is the passing of tables to and from Lua functions. How is that handled? There are a few idioms you see over and over again to make it happen. Before discussing the idioms, here's the code…
系列教程指南[1] 注意 在你学习了sol的基础知识之后,建议你如果认为某些东西可以运行,你应该尝试一下.它可能会运行! 以下所有代码均可在sol2教程示例中找到. 断言/先决条件 The implementation for assert.hpp with c_assert looks like so: 你需要代码中#include<sol.hpp>#include "sol.hpp".SOL只有头文件,所以你不需要编译任何东西.但是,Lua必须编译并可用.有关更多详细信…
主要是挖个坑.候补(代码还没看完..) https://github.com/antirez/redis/tree/5.0 一.Redis保存持久化文件 二.Redis启动加载持久化文件 src/server.c loadDataFromDisk函数 AOF 和 RDB 通过不同的方式加载 /* Function called at startup to load RDB or AOF file in memory. */ void loadDataFromDisk(void) { long l…