[Tarantool-patches] [PATCH v3 00/10] fix say_x format and rework fibers

Cyrill Gorcunov gorcunov at gmail.com
Wed May 12 00:24:36 MSK 2021


On Wed, May 12, 2021 at 12:15:39AM +0300, Cyrill Gorcunov wrote:
> On Tue, May 11, 2021 at 10:13:01PM +0200, Vladislav Shpilevoy wrote:
> > Hi! Good job on the fixes, really!
> > 
> > Although function lbox_fiber_statof() still uses lua_pushinteger():
> > 
> 
> Thanks a huge for catching it, Vlad. Here is an update. Squashed
> to patch 1 "fiber: use uint64_t for fiber IDs" and force pushed.

And one more addon (squashed) because 20 chars won't fit 8 byte
unsiged together with "fiber: " prefix. Also I'm a bit worried of

static int
lbox_fiber_top_entry(struct fiber *f, void *cb_ctx)
{
	struct lua_State *L = (struct lua_State *) cb_ctx;

-->	lua_pushfstring(L, "%f/%s", (lua_Number)f->fid, f->name);

why do we use float formate here at all?!

---
 src/lua/fiber.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lua/fiber.c b/src/lua/fiber.c
index 0d28fce8c..83c259c45 100644
--- a/src/lua/fiber.c
+++ b/src/lua/fiber.c
@@ -748,7 +748,7 @@ lbox_fiber_serialize(struct lua_State *L)
 static int
 lbox_fiber_tostring(struct lua_State *L)
 {
-	char buf[20];
+	char buf[32];
 	struct fiber *f = lbox_checkfiber(L, 1);
 	snprintf(buf, sizeof(buf), "fiber: %llu",
 		 (long long)f->fid);
-- 
2.31.1



More information about the Tarantool-patches mailing list