doc: documented the NGX_LUA_USE_ASSERT and NGX_LUA_ABORT_AT_PANIC C macros.

This commit is contained in:
Yichun Zhang (agentzh) 2014-07-04 18:08:39 -07:00
Родитель 4c215c5562
Коммит c29f33adf1
2 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -20,6 +20,7 @@ Table of Contents
* [Typical Uses](#typical-uses)
* [Nginx Compatibility](#nginx-compatibility)
* [Installation](#installation)
* [C Macro Configurations](#c-macro-configurations)
* [Installation on Ubuntu 11.10](#installation-on-ubuntu-1110)
* [Community](#community)
* [English Mailing List](#english-mailing-list)
@ -343,6 +344,24 @@ make -j2
make install
```
[Back to TOC](#table-of-contents)
C Macro Configurations
----------------------
While building this module either via OpenResty or with the NGINX core, you can define the following C macros via the C compiler options:
* `NGX_LUA_USE_ASSERT`
When defined, will enable assertions in the ngx_lua C code base. Recommended for debugging or testing builds. It can introduce some (small) runtime overhead when enabled. This macro was first introduced in the `v0.9.10` release.
* `NGX_LUA_ABORT_AT_PANIC`
When the Lua/LuaJIT VM panics, ngx_lua will instruct the current nginx worker process to quit gracefully by default. By specifying this C macro, ngx_lua will abort the current nginx worker process (which usually result in a core dump file) immediately. This option is useful for debugging VM panics. This option was first introduced in the `v0.9.8` release.
To enable one or more of these macros, just pass extra C compiler options to the `./configure` script of either NGINX or OpenResty. For instance,
./configure --with-cc-opt="-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC"
[Back to TOC](#table-of-contents)
Installation on Ubuntu 11.10
@ -6693,3 +6712,4 @@ Identical to the standard Lua [coroutine.status](http://www.lua.org/manual/5.1/m
This API was first usable in the context of [init_by_lua*](#init_by_lua) since the `0.9.2`.
This API was first enabled in the `v0.6.0` release.

Просмотреть файл

@ -281,6 +281,21 @@ Build the source with this module:
make install
</geshi>
== C Macro Configurations ==
While building this module either via OpenResty or with the NGINX core, you can define the following C macros via the C compiler options:
* <code>NGX_LUA_USE_ASSERT</code>
: When defined, will enable assertions in the ngx_lua C code base. Recommended for debugging or testing builds. It can introduce some (small) runtime overhead when enabled. This macro was first introduced in the <code>v0.9.10</code> release.
* <code>NGX_LUA_ABORT_AT_PANIC</code>
: When the Lua/LuaJIT VM panics, ngx_lua will instruct the current nginx worker process to quit gracefully by default. By specifying this C macro, ngx_lua will abort the current nginx worker process (which usually result in a core dump file) immediately. This option is useful for debugging VM panics. This option was first introduced in the <code>v0.9.8</code> release.
To enable one or more of these macros, just pass extra C compiler options to the <code>./configure</code> script of either NGINX or OpenResty. For instance,
<geshi>
./configure --with-cc-opt="-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC"
</geshi>
== Installation on Ubuntu 11.10 ==
Note that it is recommended to use LuaJIT 2.0 or LuaJIT 2.1 instead of the standard Lua 5.1 interpreter wherever possible.
@ -5668,3 +5683,4 @@ Identical to the standard Lua [http://www.lua.org/manual/5.1/manual.html#pdf-cor
This API was first usable in the context of [[#init_by_lua|init_by_lua*]] since the <code>0.9.2</code>.
This API was first enabled in the <code>v0.6.0</code> release.