[tarantool-patches] Re: [PATCH 1/2] lib/core/fiber: Rename stack_direction to stack_growsdown

  • From: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
  • To: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
  • Date: Wed, 27 Mar 2019 12:35:10 +0300

On Tue, Mar 19, 2019 at 10:38:44PM +0300, Cyrill Gorcunov wrote:

Since growsdown (or growsup) is more clear and common name.
---
 src/lib/core/fiber.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c
index c55b3ab39..922a0bfe8 100644
--- a/src/lib/core/fiber.c
+++ b/src/lib/core/fiber.c
@@ -105,7 +105,7 @@ __thread struct cord *cord_ptr = NULL;
 pthread_t main_thread_id;
 
 static size_t page_size;
-static int stack_direction;
+static bool stack_growsdown;
 
 enum {
      /* The minimum allowable fiber stack size in bytes */
@@ -808,7 +808,7 @@ fiber_stack_recycle(struct fiber *fiber)
       * it anyway.
       */
      void *start, *end;
-     if (stack_direction < 0) {
+     if (stack_growsdown) {

TBO I like stack_direction more as it's looks symmetrical, so to say.
I'd refrain from changing this if there's no other reason rather than
personal taste.

Other related posts: