From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 75A3F446439 for ; Thu, 17 Sep 2020 16:51:50 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id u8so2287188lff.1 for ; Thu, 17 Sep 2020 06:51:50 -0700 (PDT) From: Cyrill Gorcunov Date: Thu, 17 Sep 2020 16:51:20 +0300 Message-Id: <20200917135121.60380-3-gorcunov@gmail.com> In-Reply-To: <20200917135121.60380-1-gorcunov@gmail.com> References: <20200917135121.60380-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/3] lua/errno: shrink memory usage on error declaration List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Alexander Turenko There is no need to allocate 32 bytes per each string, the backend lua does copy the string internally thus plain pointer is enough here no need to allocate redundant memory. Part-of #5034 Signed-off-by: Cyrill Gorcunov --- src/lua/errno.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/errno.c b/src/lua/errno.c index 3d3947e75..c0a416c11 100644 --- a/src/lua/errno.c +++ b/src/lua/errno.c @@ -42,7 +42,7 @@ extern char errno_lua[]; void tarantool_lua_errno_init(struct lua_State *L) { - static const struct { char name[32]; int value; } elist[] = { + static const struct { char *name; int value; } elist[] = { #ifdef E2BIG { "E2BIG", E2BIG }, -- 2.26.2