From ad6dee69036c6eaa4929fe259955021e7713f3eb Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Thu, 19 Dec 2013 16:53:27 +0400
Subject: [PATCH] Minor improvements.

---
 src/lib/small/mempool.c | 2 +-
 src/lib/small/small.h   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/small/mempool.c b/src/lib/small/mempool.c
index 99dd415508..052242470a 100644
--- a/src/lib/small/mempool.c
+++ b/src/lib/small/mempool.c
@@ -54,7 +54,7 @@ mslab_create(struct mslab *slab, struct mempool *pool)
 }
 
 /** Beginning of object data in the slab. */
-void *
+static inline void *
 mslab_offset(struct mslab *slab)
 {
 	return (char *) slab + mslab_sizeof() +
diff --git a/src/lib/small/small.h b/src/lib/small/small.h
index 08a30da847..2ae8a9029f 100644
--- a/src/lib/small/small.h
+++ b/src/lib/small/small.h
@@ -206,7 +206,8 @@ smfree(struct small_alloc *alloc, void *ptr)
 	struct mslab *slab = (struct mslab *)
 		slab_from_ptr(alloc->cache, ptr, alloc->slab_order);
 	struct mempool *pool = slab->pool;
-	mempool_free(pool, ptr);
+	pool->slabs.stats.used -= pool->objsize;
+	mslab_free(pool, slab, ptr);
 	/*
 	 * Don't keep around empty factored pools
 	 * if the allocator is out of them.
-- 
GitLab