From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0B1EA2E26D for ; Sun, 9 Jun 2019 16:44:51 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aIHPkhahl4FU for ; Sun, 9 Jun 2019 16:44:50 -0400 (EDT) Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 982702E1F4 for ; Sun, 9 Jun 2019 16:44:50 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] [PATCH v3 03/14] txn: transaction memory allocation Date: Sun, 9 Jun 2019 23:44:32 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Georgy Kirichenko Enable to allocate a chunk of memory on a transaction memory region. Prerequisites: #1254 --- src/box/txn.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/box/txn.h b/src/box/txn.h index f4d861824..196a7dcc1 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -393,6 +393,15 @@ txn_vdbe() return txn->psql_txn->vdbe; } +/** + * Allocate a chunk of memory on a txn memory region. + */ +static inline void * +txn_alloc(struct txn *txn, size_t size) +{ + return region_alloc(&txn->region, size); +} + /** * FFI bindings: do not throw exceptions, do not accept extra * arguments -- 2.21.0