comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Containers.Hash_Type -> 64 bit
@ 2013-08-30 14:32 Peter Brooks
  2013-08-30 14:45 ` G.B.
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Brooks @ 2013-08-30 14:32 UTC (permalink / raw)


Ada.Strings.Hash defines Ada.Containers.Hash_Type as 32 bits long. How can I increase it to 64 bits?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Containers.Hash_Type -> 64 bit
  2013-08-30 14:32 Ada.Containers.Hash_Type -> 64 bit Peter Brooks
@ 2013-08-30 14:45 ` G.B.
  2013-08-30 15:43   ` Peter Brooks
  0 siblings, 1 reply; 4+ messages in thread
From: G.B. @ 2013-08-30 14:45 UTC (permalink / raw)


On 30.08.13 16:32, Peter Brooks wrote:
> Ada.Strings.Hash defines Ada.Containers.Hash_Type as 32 bits long. How can I increase it to 64 bits?
>
I suspect you can't since Hash_Type is implementation-defined.
(Implying that you'd have to change, or at least check, the
implementation of everything involving Hash_Type.)

A quirky workaround might be to use two hash tables,
one for the upper quadword, and one for the lower.

But the standard containers aren't made for speed,
anyway; if that's the goal, I'd look elsewhere.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Containers.Hash_Type -> 64 bit
  2013-08-30 14:45 ` G.B.
@ 2013-08-30 15:43   ` Peter Brooks
  2013-08-31  0:55     ` Ludovic Brenta
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Brooks @ 2013-08-30 15:43 UTC (permalink / raw)


On Friday, 30 August 2013 16:45:57 UTC+2, G.B.  wrote:
> On 30.08.13 16:32, Peter Brooks wrote:
> 
> > Ada.Strings.Hash defines Ada.Containers.Hash_Type as 32 bits long. How can I increase it to 64 bits?
> 
> >
> 
> I suspect you can't since Hash_Type is implementation-defined.
> (Implying that you'd have to change, or at least check, the
> implementation of everything involving Hash_Type.)
> 
> A quirky workaround might be to use two hash tables,
>  one for the upper quadword, and one for the lower.
> 
Thank you! That's a pity, but there we are. It looks as if I'll have to re-write it.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Containers.Hash_Type -> 64 bit
  2013-08-30 15:43   ` Peter Brooks
@ 2013-08-31  0:55     ` Ludovic Brenta
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Brenta @ 2013-08-31  0:55 UTC (permalink / raw)


Peter Brooks writes on comp.lang.ada:
> On Friday, 30 August 2013 16:45:57 UTC+2, G.B.  wrote:
>> On 30.08.13 16:32, Peter Brooks wrote:
>> 
>>> Ada.Strings.Hash defines Ada.Containers.Hash_Type as 32 bits
>>> long. How can I increase it to 64 bits?
>> 
>> I suspect you can't since Hash_Type is implementation-defined.
>> (Implying that you'd have to change, or at least check, the
>> implementation of everything involving Hash_Type.)
>> 
>> A quirky workaround might be to use two hash tables, one for the
>> upper quadword, and one for the lower.
>> 
> Thank you! That's a pity, but there we are. It looks as if I'll have
> to re-write it.

Out of curiosity, why do you think you need a 64-bit hash_type? Do you
expect more than 4 billion objects in your table? If so, what is the
expected total size your hash table, and are you sure the address space
on your target platform is large enough to accommodate it?

Maybe this is an on-disk hash_table, IOW a content-addressed file system
you are designing?

-- 
Ludovic Brenta.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-31  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 14:32 Ada.Containers.Hash_Type -> 64 bit Peter Brooks
2013-08-30 14:45 ` G.B.
2013-08-30 15:43   ` Peter Brooks
2013-08-31  0:55     ` Ludovic Brenta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox