From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5B2A925291 for ; Wed, 14 Aug 2019 06:36:28 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B1mjffL0KQRw for ; Wed, 14 Aug 2019 06:36:28 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 131E626028 for ; Wed, 14 Aug 2019 06:36:27 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [tarantool-patches] Re: [PATCH 1/2] Move mp_compare_double_uint64() to trivia.h From: "n.pettik" In-Reply-To: Date: Wed, 14 Aug 2019 13:36:25 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <9688F1C1-2798-4D7C-A2B2-65ACDBC63E9D@tarantool.org> References: <2ff7204c9f8b908b028bec926635118ce1982674.1565120194.git.korablev@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy > On 9 Aug 2019, at 00:37, Vladislav Shpilevoy = wrote: >=20 > Hi! Thanks for the patch! >=20 >> diff --git a/src/trivia/util.h b/src/trivia/util.h >> index 1e01013db..ebfe0c392 100644 >> --- a/src/trivia/util.h >> +++ b/src/trivia/util.h >> @@ -500,6 +500,20 @@ json_escape(char *buf, int size, const char = *data); >> } = \ >> } while(0) >>=20 >> +#define COMPARE_RESULT(a, b) (a < b ? -1 : a > b) >> + >> +/** >> + * Compare LHS with RHS, return a value <0, 0 or >0 depending on the >> + * comparison result (strcmp-style). >> + * Normally, K=3D=3D1. If K=3D=3D-1, the result is inverted (as if = LHS and RHS >> + * were swapped). >> + * K is needed to enable tail call optimization in Release build. >> + * NOINLINE attribute was added to avoid aggressive inlining which >=20 > I guess, NOINLINE does not make sense anymore. But you can keep a > comment, that inlining should not be added in future for the sake > of tail call optimization. Thx, fixed: diff --git a/src/trivia/util.h b/src/trivia/util.h index ebfe0c392..8a3d22b38 100644 --- a/src/trivia/util.h +++ b/src/trivia/util.h @@ -508,8 +508,6 @@ json_escape(char *buf, int size, const char *data); * Normally, K=3D=3D1. If K=3D=3D-1, the result is inverted (as if LHS = and RHS * were swapped). * K is needed to enable tail call optimization in Release build. - * NOINLINE attribute was added to avoid aggressive inlining which - * resulted in over 2Kb code size for mp_compare_number. */ int double_compare_uint64(double lhs, uint64_t rhs, int k); Also fixed commit subject according to your nit: Move mp_compare_double_uint64() to trivia/util.h