[Tarantool-patches] [PATCH luajit v1 03/11] profile: introduce profiler writing module

Sergey Kaplun skaplun at tarantool.org
Fri Dec 25 13:13:24 MSK 2020


On 25.12.20, Igor Munkin wrote:
> Sergey,
> 
> On 25.12.20, Sergey Kaplun wrote:
> > On 24.12.20, Sergey Ostanevich wrote:
> 
> <snipped>
> 
> > > 
> > > +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.

> 
> > 
> 
> <snipped>
> 
> > 
> > -- 
> > Best regards,
> > Sergey Kaplun
> 
> -- 
> Best regards,
> IM

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list