Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB6tY-0004sp-S4 for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Nov 2016 21:21:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cB6tY-0001mB-Em for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Nov 2016 21:21:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cB6tX-0001m4-Nm for pgsql-hackers@postgresql.org; Sun, 27 Nov 2016 21:21:55 +0000 Received: from mail-wj0-x22e.google.com ([2a00:1450:400c:c01::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cB6tU-0001rz-Ro for pgsql-hackers@postgresql.org; Sun, 27 Nov 2016 21:21:55 +0000 Received: by mail-wj0-x22e.google.com with SMTP id qp4so100100360wjc.3 for ; Sun, 27 Nov 2016 13:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=NpuKIEPsm2EDEeMFHSw7oDSAmkyFO6Y+pqjd3F/PmTU=; b=l5JAoIBSV183KPGRi0BFycDqMXCxqSGpiB9M/uiFFYp2lQt1Atq9bNoZTkxCbnm2kU W4vUhS0g9B5wUqRzSeFdur0fetyv8BgyUcAK7pNE30Wtt7q/baa7YXJSgH6pr9GvaxLg WPWbUf4DHEG0dtRnlvQeiu1bUri3OHDWsPZiYoceEjvxoabFx6rn/UulVOnNBN6DPxIm g4dXElnKFuE5DlezO8nJuKZEi4sSS7FmT56m0w0x2YLGkY8/2upNCfbZJGJWjVRcm5dx fjRa0tbnp3ZZr3oVhAuh901FuSLBULDV46MpDMlIPzR2ROPPhpW16hvhv1I/NqVvUYRe cSYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NpuKIEPsm2EDEeMFHSw7oDSAmkyFO6Y+pqjd3F/PmTU=; b=CCTct/JwPAQ821u96ofxAIsQmiT/RCMVGjaJMnl7Q7VAWdD4sMt8yIQZrIx8EMcoib c/AkxSTjU+LqFkCcs9IhF1VrI9S1NHwBLK85FIyI0TYkb9CqFZPJdZoCfiE+U5mokK3R MErcTDYbXcX6+KIubBxlwT1P2e0Y94Q3MCOyCLx4t/+3vJ1qHidTuvTUBNq8PVSdzsD5 YNKhJEOhKkMBNVprcHOxjDIQUr2TMOISKKeNr0+EH4A770/JWTiGKtiMr0yFX6i1R6Qn wC3hGd+DMjR1xCyNWsL3+sp6CXWGbKh8mm7RPBGQSZmgeqx2BKHuUe1PpVwFR6jqcnD8 o+TA== X-Gm-Message-State: AKaTC03QD52Ev4tObD5xAjgVvT/qhs/LI6oHCxGwnfW9a9jq5vcEOYQZt4wjtIM7M4iHl9X1zV1gMuYdj0ShRjuNhIB/G4JiRV3kSzdya7Z2H4kI/K+ap9ymtao7x5CsU/lenIe5UjG54QPfCDD3R67kdVjz5vRgUutglcYgos80CzLJuTNFUVdkazMxGHBppg== X-Received: by 10.194.96.110 with SMTP id dr14mr16372039wjb.209.1480281711120; Sun, 27 Nov 2016 13:21:51 -0800 (PST) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id w8sm25238592wmw.4.2016.11.27.13.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 13:21:50 -0800 (PST) Subject: Re: PATCH: two slab-like memory allocators To: Andres Freund , Tomas Vondra References: <9818b54a-fcb6-f018-0b16-96d6a1d1da27@2ndquadrant.com> <34a6d4ea-7f3d-a62c-fff1-7a9108c078d7@2ndquadrant.com> <4f176a6c-c197-165d-dee4-5de8f279f1f4@2ndquadrant.com> <20161112191257.3a4n6kzegvu637qn@alap3.anarazel.de> <20161127204740.dr3swudwsbafjuof@alap3.anarazel.de> Cc: Robert Haas , John Gorman , pgsql-hackers From: Petr Jelinek Message-ID: Date: Sun, 27 Nov 2016 22:21:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161127204740.dr3swudwsbafjuof@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 27/11/16 21:47, Andres Freund wrote: > Hi, > >>> +typedef struct SlabBlockData *SlabBlock; /* forward reference */ >>> +typedef struct SlabChunkData *SlabChunk; >>> >>> Can we please not continue hiding pointers behind typedefs? It's a bad >>> pattern, and that it's fairly widely used isn't a good excuse to >>> introduce further usages of it. >>> >> >> Why is it a bad pattern? > > It hides what is passed by reference, and what by value, and it makes it > a guessing game whether you need -> or . since you don't know whether > it's a pointer or the actual object. All to save a * in parameter and > variable declaration?... > FWIW I don't like that pattern either although it's used in many parts of our code-base. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers