Skip to content

Commit

Permalink
feat(ffi) kv & metrics shms APIs
Browse files Browse the repository at this point in the history
Co-authored-by: Thibault Charbonnier <[email protected]>
  • Loading branch information
casimiro and thibaultcha committed Sep 20, 2024
1 parent 24b5b15 commit f017130
Show file tree
Hide file tree
Showing 26 changed files with 2,203 additions and 23 deletions.
12 changes: 12 additions & 0 deletions lib/resty/wasmx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ local base = require "resty.core.base"


local C = ffi.C
local assert = assert
local get_string_buf = base.get_string_buf
local get_size_ptr = base.get_size_ptr
local DEBUG_MODE = ngx.config.debug


ffi.cdef [[
Expand All @@ -17,6 +19,9 @@ ffi.cdef [[

typedef unsigned char u_char;
typedef intptr_t ngx_int_t;
typedef uintptr_t ngx_uint_t;
typedef ngx_uint_t ngx_msec_t;
typedef struct ngx_log_s ngx_log_t;
typedef struct ngx_wavm_t ngx_wasm_vm_t;
typedef struct ngx_wasm_ops_plan_t ngx_wasm_plan_t;

Expand Down Expand Up @@ -58,4 +63,11 @@ function _M.get_err_ptr()
end


function _M.assert_debug(...)
if DEBUG_MODE then
return assert(...)
end
end


return _M
Loading

0 comments on commit f017130

Please sign in to comment.