From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 5741C4765E0 for ; Fri, 25 Dec 2020 13:14:10 +0300 (MSK) Date: Fri, 25 Dec 2020 13:13:24 +0300 From: Sergey Kaplun Message-ID: <20201225101324.GR9101@root> References: <0adaa12ef5be0efc1d9c79ab746b8149c252d661.1608142899.git.skaplun@tarantool.org> <20201221092415.GT5396@tarantool.org> <20201224064656.GH9101@root> <4216B30D-84B1-4A46-8DD7-C1A51587D7FF@tarantool.org> <20201224212037.GM9101@root> <20201225093724.GE5396@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201225093724.GE5396@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH luajit v1 03/11] profile: introduce profiler writing module List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org On 25.12.20, Igor Munkin wrote: > Sergey, > > On 25.12.20, Sergey Kaplun wrote: > > On 24.12.20, Sergey Ostanevich wrote: > > > > > > > > > +void lj_wbuf_init(struct lj_wbuf *buf, lj_wbuf_writer writer, void *ctx, > > > + uint8_t *mem, size_t size) > > > +{ > > > + lua_assert(size >= LEB128_U64_MAXSIZE); > > > > > > Is it meaningful to allocate just 10bytes? > > > > No, but at least we should check it. We need at least 10bytes buffer to > > write huge addresses leb128-encoded. > > Again, this is a *general purpose write buffer*, so I agree with Sergos, > that this assert looks odd here. Hmm, valid. It can be used for writing bytes only. OK, I'll remove this assert. > > > > > > > > > > -- > > Best regards, > > Sergey Kaplun > > -- > Best regards, > IM -- Best regards, Sergey Kaplun