From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D8AB54696C0 for ; Fri, 22 Nov 2019 05:47:08 +0300 (MSK) From: Ilya Kosarev Date: Fri, 22 Nov 2019 05:46:50 +0300 Message-Id: <5204e31ae0a6050f5d8202c61f2a5e0a75c6d9fb.1574390065.git.i.kosarev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH v5 2/8] refactoring: specify struct name in allocation diagnostics List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org In case of allocation problems in region alloc we were setting diagnostics using "new slab" stub. Now we specify concrete struct name which was going to be allocated. Part of #4247 --- src/box/alter.cc | 8 ++++---- src/box/user.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/box/alter.cc b/src/box/alter.cc index 022c7dfa2..16e3f7d37 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -540,7 +540,7 @@ space_format_decode(const char *data, uint32_t *out_count, struct field_def *region_defs = (struct field_def *) region_alloc(region, size); if (region_defs == NULL) { - diag_set(OutOfMemory, size, "region", "new slab"); + diag_set(OutOfMemory, size, "region", "struct field_def"); return -1; } /* @@ -810,7 +810,7 @@ txn_alter_trigger_new(trigger_f run, void *data) region_aligned_alloc(&in_txn()->region, size, alignof(struct trigger)); if (trigger == NULL) { - diag_set(OutOfMemory, size, "region", "new slab"); + diag_set(OutOfMemory, size, "region", "struct trigger"); return NULL; } trigger = (struct trigger *)memset(trigger, 0, size); @@ -861,7 +861,7 @@ alter_space_new(struct space *old_space) region_aligned_alloc(&in_txn()->region, size, alignof(struct alter_space)); if (alter == NULL) { - diag_set(OutOfMemory, size, "region", "new slab"); + diag_set(OutOfMemory, size, "region", "struct alter_space"); return NULL; } alter = (struct alter_space *)memset(alter, 0, size); @@ -4824,7 +4824,7 @@ decode_fk_links(struct tuple *tuple, uint32_t *out_count, struct field_link *region_links = (struct field_link *)region_alloc(&fiber()->gc, size); if (region_links == NULL) { - diag_set(OutOfMemory, size, "region", "new slab"); + diag_set(OutOfMemory, size, "region", "struct field_link"); return NULL; } memset(region_links, 0, size); diff --git a/src/box/user.cc b/src/box/user.cc index 39520f231..a012cb196 100644 --- a/src/box/user.cc +++ b/src/box/user.cc @@ -196,7 +196,7 @@ user_grant_priv(struct user *user, struct priv_def *def) old = (struct priv_def *) region_alloc(&user->pool, size); if (old == NULL) { - diag_set(OutOfMemory, size, "region", "new slab"); + diag_set(OutOfMemory, size, "region", "struct priv_def"); return -1; } *old = *def; -- 2.17.1