From d4a69658a180cf2cbb0280aa9b04abb875d84d77 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 29 Oct 2017 16:18:20 +0900 Subject: [PATCH] Add another warning about mruby --- doc/nghttpx.h2r | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/nghttpx.h2r b/doc/nghttpx.h2r index e657b0f6..f2b7abca 100644 --- a/doc/nghttpx.h2r +++ b/doc/nghttpx.h2r @@ -282,6 +282,14 @@ MRUBY SCRIPTING The current mruby extension API is experimental and not frozen. The API is subject to change in the future release. +.. warning:: + + Almost all string value returned from method, or attribute is a + fresh new mruby string, which involves memory allocation, and + copies. Therefore, it is strongly recommended to store a return + value in a local variable, and use it, instead of calling method or + accessing attribute repeatedly. + nghttpx allows users to extend its capability using mruby scripts. nghttpx has 2 hook points to execute mruby script: request phase and response phase. The request phase hook is invoked after all request