Log: Align path size.

This commit is contained in:
Nodir Temirkhodjaev 2015-01-16 08:11:08 +05:00
parent 1d8d596a99
commit 05b1d7852c
2 changed files with 4 additions and 2 deletions

View File

@ -2,9 +2,11 @@
#define WIPF_BUFFER_SIZE 16 * 1024
#define WIPF_LOG_PATH_MAX 512
#define WIPF_LOG_ALIGN 4
#define WIPF_LOG_SIZE(path_len) \
(sizeof(UINT32) + sizeof(UINT32) + sizeof(UINT32) + (path_len))
((sizeof(UINT32) + sizeof(UINT32) + sizeof(UINT32) + (path_len)) \
+ (WIPF_LOG_ALIGN-1)) & ~(WIPF_LOG_ALIGN-1)
static void

View File

@ -9,7 +9,7 @@ local mem, win32 = sys.mem, sys.win32
print"-- Log Write"
do
local path = "/test"
local outlen = 12 + #path
local outlen = 12 + #path + 3
local bufsize = outlen + 4
local buf = assert(mem.pointer(bufsize))