public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>,
	David Malcolm <dmalcolm@redhat.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] irange_pool class
Date: Mon, 28 Sep 2020 11:56:45 -0400	[thread overview]
Message-ID: <e8d12c12-db8e-71ed-9a69-108b7bc30b60@redhat.com> (raw)
In-Reply-To: <41967a78-56f3-675c-9243-06d07668e8cd@redhat.com>

On 9/18/20 1:03 PM, Aldy Hernandez wrote:
> On 9/18/20 6:42 PM, Andrew MacLeod wrote:
>> On 9/18/20 8:28 AM, David Malcolm wrote:I think of a "pool allocator" 
>> as something that makes a small
>>>>> number of
>>>>> large allocation under the covers, and then uses that to serve
>>>>> large
>>>>> numbers of fixed sized small allocations and deallocations with
>>>>> O(1)
>>>>> using a free list.
>>>> Ah, I didn't know pool had a different meaning.
>>> See e.g. gcc/alloc-pool.h
>>
>> The name originated when the original v1 version was based on using 
>> alloc-pool.h.  when we went to varying sizes, we switched to and 
>> obstack implementation  and never changed the name.
>>   <...>
>>
>>>>> I think it would be clearer to name this "irange_obstack", or
>>>>> somesuch.
>>>> I'd prefer something more generic.  We don't want to tie the name of
>>>> the
>>>> allocator to the underlying implementation.  What if we later change
>>>> to
>>>> malloc?  We'd have to change the name to irange_malloc.
>>>> irange_allocator?  Or is there something more generically appropriate
>>>> here?
>>> How about "irange_bump_allocator?"   Rather long, but it expresses the
>>
>>
>>
>> "irange_allocator" is sufficient .      The consumer should not care 
>> what the implementation is, and we may decide to implement it 
>> differently down the road. So I don't want to imply something 
>> specific in the name or we'd have to change it again.
>
> Updated patch attached.
>
> Aldy

This is OK btw,

Andrew


      reply	other threads:[~2020-09-28 15:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 10:36 Aldy Hernandez
2020-09-17 18:02 ` Martin Sebor
2020-09-18  6:17   ` Aldy Hernandez
2020-09-18  1:43 ` David Malcolm
2020-09-18  5:49   ` Aldy Hernandez
2020-09-18 12:28     ` David Malcolm
2020-09-18 14:10       ` Aldy Hernandez
2020-09-18 17:07         ` Martin Sebor
2020-09-18 17:36           ` Andrew MacLeod
2020-09-18 20:35             ` Martin Sebor
2020-09-18 21:09               ` Andrew MacLeod
2020-09-19 20:32                 ` Martin Sebor
2020-09-20  0:40                   ` Andrew MacLeod
2020-09-20  7:01                   ` Aldy Hernandez
2020-09-21 14:14                   ` Andrew MacLeod
2020-09-18 16:42       ` Andrew MacLeod
2020-09-18 17:03         ` Aldy Hernandez
2020-09-28 15:56           ` Andrew MacLeod [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8d12c12-db8e-71ed-9a69-108b7bc30b60@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).