From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5AA9846970E for ; Wed, 5 Feb 2020 13:06:23 +0300 (MSK) Received: by mail-lf1-f66.google.com with SMTP id b15so1056659lfc.4 for ; Wed, 05 Feb 2020 02:06:23 -0800 (PST) Date: Wed, 5 Feb 2020 13:06:20 +0300 From: Cyrill Gorcunov Message-ID: <20200205100620.GK12445@uranus> References: <20200128192249.10023-1-gorcunov@gmail.com> <20200128192249.10023-3-gorcunov@gmail.com> <20200203143928.GG547@tarantool.org> <20200204221556.GE20146@atlas> <20200205074655.GH12445@uranus> <20200205094945.GB4624@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205094945.GB4624@atlas> Subject: Re: [Tarantool-patches] [PATCH v7 2/5] box/applier: add missing diag_set on region_alloc failure List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: tml On Wed, Feb 05, 2020 at 12:49:46PM +0300, Konstantin Osipov wrote: > > > > IOW I think we should handle NULLs to be stable in long terms. > > While I sort of agree with the discipline of checking the malloc > return value, just as a style habit, you won't get NULL > from malloc() in practice. OOM killer will do its job first. > > Also if you do, you're just as good crashing next line, when > accessing null pointer. Actually I've seen some ticket in our github about wrapping malloc with xmalloc which would crash on malloc failure. IOW, lets leave explisit check for now.