From 126470cc7b6c2314c02805e4d00afe04b6b00312 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Tue, 10 May 2011 22:32:01 +0930 Subject: Add runtime option for persistent encode buffer --- README | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'README') diff --git a/README b/README index 1ff12d9..3fa7595 100644 --- a/README +++ b/README @@ -34,8 +34,7 @@ Build requirements: Or: - LuaJIT (http://www.luajit.org/) -The included Makefile should be reviewed. Updated the Makefile to suit -your platform and Lua header/library directories. Then: +Review and update the included Makefile to suit your platform. Then: # make # make install @@ -66,6 +65,7 @@ Synopsis setting = cjson.refuse_invalid_numbers([setting]) depth = cjson.encode_max_depth([depth]) convert, ratio, safe = cjson.encode_sparse_array([convert[, ratio[, safe]]]) + keep = cjson.encode_keep_buffer([keep]) Encoding @@ -204,6 +204,19 @@ the application. Eg: a = {}; b = { a }; a[1] = b +Persistent encoding buffer +------------------------- + + keep = cjson.keep_encode_buffer([keep]) + -- "keep" must be a boolean + +By default, CJSON will reuse the JSON encoding buffer to improve +performance. The buffer will grow to the largest size required and is +not freed until CJSON is garbage collected. Setting this option to +"false" will cause the buffer to be freed after each call to +cjson.encode(). + + References ========== -- cgit v1.2.3-55-g6feb