码迷,mamicode.com
首页 > 编程语言 > 详细

Some ideas to embedding lua into C/C++

时间:2015-09-03 10:19:09      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

http://blog.csdn.net/cnjet/article/details/5909693

 

1. Two different way

     lua_open can create a new lua_State. Every lua_State has its own execute environment. So, we can create more than one lua_State.

     Way 1: Create a lua_State, load all lua script in it. Call functions in the lua_State, they share same global variables.

     Way 2: Create a lua_State for every lua script. Every lua script work in its own lua_State.

 

 

2.  Lua standard library

     "luaL_openlibs" open all standard libraries. It‘s not necessarily, you can ignore it to reduce memory size.

Some ideas to embedding lua into C/C++

标签:

原文地址:http://www.cnblogs.com/gamekk/p/4779922.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!