Re: allowing broader use of simplehash

2019-12-17 Thread Robert Haas
On Sat, Dec 14, 2019 at 10:24 PM Robert Haas wrote: > On Thu, Dec 12, 2019 at 2:33 PM Andres Freund wrote: > > I was basically just thinking that we could pass the context to use via > > CurrentMemoryContext, instead of explicitly passing it in. > > I thought about that, but as a general rule,

Re: allowing broader use of simplehash

2019-12-14 Thread Robert Haas
On Thu, Dec 12, 2019 at 2:33 PM Andres Freund wrote: > I was basically just thinking that we could pass the context to use via > CurrentMemoryContext, instead of explicitly passing it in. I thought about that, but as a general rule, replacing a function parameter with a global variable is the

Re: allowing broader use of simplehash

2019-12-12 Thread Andres Freund
Hi, On 2019-12-11 10:50:16 -0500, Robert Haas wrote: > On Tue, Dec 10, 2019 at 4:59 PM Andres Freund wrote: > > 3) For lots of one-off uses of hashtables that aren't performance > >critical, we want a *simple* API. That IMO would mean that key/value > >end up being separately allocated

Re: allowing broader use of simplehash

2019-12-12 Thread Andres Freund
Hi, On 2019-12-11 10:05:00 -0500, Robert Haas wrote: > On Tue, Dec 10, 2019 at 4:59 PM Andres Freund wrote: > > > A significant problem in either case is that a simplehash wants to > > > live in a memory context; no such thing exists either for data in > > > shared memory nor in frontend code.

Re: allowing broader use of simplehash

2019-12-11 Thread Robert Haas
On Tue, Dec 10, 2019 at 4:59 PM Andres Freund wrote: > 3) For lots of one-off uses of hashtables that aren't performance >critical, we want a *simple* API. That IMO would mean that key/value >end up being separately allocated pointers, and that just a >comparator is provided when

Re: allowing broader use of simplehash

2019-12-11 Thread Robert Haas
On Tue, Dec 10, 2019 at 4:59 PM Andres Freund wrote: > Neat! Thanks. > > A significant problem in either case is that a simplehash wants to > > live in a memory context; no such thing exists either for data in > > shared memory nor in frontend code. However, it seems to be quite easy > > to

Re: allowing broader use of simplehash

2019-12-10 Thread Andres Freund
Hi, Neat! On 2019-12-10 13:07:02 -0500, Robert Haas wrote: > I recently became annoyed while working on patch A that I could not > use simplehash in shared memory, and then I became annoyed again while > working on patch B that I could not use simplehash in frontend code. > So here are a few

allowing broader use of simplehash

2019-12-10 Thread Robert Haas
I recently became annoyed while working on patch A that I could not use simplehash in shared memory, and then I became annoyed again while working on patch B that I could not use simplehash in frontend code. So here are a few patches for discussion. A significant problem in either case is that a