From owner-freebsd-arch@freebsd.org Sat Apr 4 16:40:43 2020 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A35D327971C for ; Sat, 4 Apr 2020 16:40:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48vjGS4jl4z4Ktp for ; Sat, 4 Apr 2020 16:40:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x742.google.com with SMTP id o10so11524563qki.10 for ; Sat, 04 Apr 2020 09:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yYANDCliztoV7DDvy6uNfFHWTRCkCd4Xq9wTP9M92Nw=; b=HxIo/Bkk6TPPpfwax3QEGlD5vB++8yGqGYPPJEY91wExWA1CiVJFv0Xh/fFa4HXKb3 h1QtYFgztMr+Su0w3kUscrOOnbzRKal16Uun8a/ZzuvAOnyRseBc+xL9btSkv+u+lW1F x4sXKpUeeNQ6dilQBPOwtTK0EGyn3NCy7ydTmGzVAIB2+h42y6fVEQs/+qo1qLQDca8v MeQrVBt3scc4RBOlhsUVH7o2zWiywKsqM/nyI8nvh9eL9jVqjND3TTeJ8uoUiy2MvP+G 3+GWtAOTSpL5FeIwC5uzV9U5OqeHTFyyhqI1eWV9v82N3qn7rka2ieBwrpSbPCXvB+A3 W25w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yYANDCliztoV7DDvy6uNfFHWTRCkCd4Xq9wTP9M92Nw=; b=ony947X0TxY5yqVq+PT/3eVTr2dDLhFMrq4zfW3YU2SbLazPtdRWOW3yqNPd+31yoV WXMtJAxc+L77e3Hlvu2dlvx3fUviKBe0FE+unXlv7NXxvKpmE6hQY0sZY3x/rjfQgQPP FeFehEdKN8GN1YYTGr7J35/ldM+mVAQqUU/2ivS0McuhAP8Bemk2F587hu7VcDRPahir PA1S0LUsmyFMbXehn+uUFVj8PK4MpMDUU3DdKJb3zF7+dBuhMCJUkZF/RCNV1vEudd0e bJZPdmneL0IVJ0+8tRDPTdnD5SWH6gkX7gtTkZE42TFXFhCmVeOt5mOELDYi4rJfT8eG jVEg== X-Gm-Message-State: AGi0PuaXHnaPqGwjjU/w9GIYSXcWf+ECUyNyvgAOHweNPOOQDlIPmTT+ beIUea11PHB6eqwkZOs5vREFzBvFWzMemKKegNFneg== X-Google-Smtp-Source: APiQypKKdf6GHEG1LVOIJFfGEMYG4V8JtlPYkiHFhXDvXApDqqnZTgbdvpGhBBN1FH5FHAEsR4xJOFqCtaPwhyhMVus= X-Received: by 2002:ae9:d886:: with SMTP id u128mr13020358qkf.240.1586018423860; Sat, 04 Apr 2020 09:40:23 -0700 (PDT) MIME-Version: 1.0 References: <6dbfb7cd-b4c8-dea8-8fc5-43e2b89e352d@FreeBSD.org> <20200331210258.GJ1992@kib.kiev.ua> <20200402113442.GL1992@kib.kiev.ua> <20200404142804.GP1992@kib.kiev.ua> In-Reply-To: <20200404142804.GP1992@kib.kiev.ua> From: Warner Losh Date: Sat, 4 Apr 2020 10:40:11 -0600 Message-ID: Subject: Re: Time to svn rm include/malloc.h To: Konstantin Belousov Cc: Jan Beich , Steve Wills , "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 48vjGS4jl4z4Ktp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=HxIo/Bkk; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::742) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.16 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.16)[ip: (0.02), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2020 16:40:43 -0000 On Sat, Apr 4, 2020, 8:28 AM Konstantin Belousov wrote: > On Sat, Apr 04, 2020 at 03:27:53AM +0200, Jan Beich wrote: > > Konstantin Belousov writes: > > > > > On Tue, Mar 31, 2020 at 03:48:54PM -0600, Warner Losh wrote: > > > > > >> On Tue, Mar 31, 2020 at 3:03 PM Konstantin Belousov < > kostikbel@gmail.com> > > >> wrote: > > >> > > >> > On Tue, Mar 31, 2020 at 04:01:23PM -0400, Steve Wills wrote: > > >> > > Yeah, a lot of ports have things like: > > >> > > > > >> > > sed -e 's/malloc.h/stdlib.h/' *.[ch] > > >> > > > > >> > > because they have autotools that check for malloc.h existence and > > >> > include it > > >> > > if it exists, so you end up with things like: > > >> > > > > >> > > ... > > >> > > #include > > >> > > ... > > >> > > #if HAVE_MALLOC_H > > >> > > #include > > >> > > #endif > > >> > > ... > > >> > > > > >> > > which ends up harmless, but sub-optimal. > > >> > > > > >> > So wouldn't it be more useful to remove warning and either include > > >> > stdlib.h or provide some parts of malloc-related defines, esp. the > > >> > non-portable bits from jemalloc ? > > >> > > > >> > > >> We've provided an error for the past 20 years. And a warning for the > last > > >> 24 years. Nobody is usefully using it today. In fact, it is getting > in the > > >> way, which is why we should just remove it entirely. > > > The file is not useful as provided by us today, sure. But other OSes, > > > namely LInux, do use it for allocator extensions features, and newer > > > Linux-only software tends to include it unconditionally. > > > > Maybe rename to . Other BSDs don't have > > while GNU libc defines malloc_usable_size in . > > malloc_usable_size is quite popular e.g., used by Firefox, sqlite3, etc. > > I think the following should be the easiest approach > > diff --git a/include/malloc.h b/include/malloc.h > index 5d7d7e8396d..2ec7e550334 100644 > --- a/include/malloc.h > +++ b/include/malloc.h > @@ -1,6 +1,3 @@ > /* $FreeBSD$ */ > -#if __STDC__ > -#error " has been replaced by " > -#else > #include > -#endif > +#include > Yes. NetBSD did something similar about a year ago. Warner >