www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - I need a nogc version of hashOf(). What are the options?

reply Gary Willoughby <dev nomad.so> writes:
I need a  nogc version of hashOf(). Here's one i'm currently 
using but it's not marked as  nogc.

https://github.com/dlang/druntime/blob/master/src/object.d#L3170

What are the options now?

Is there anything D offers that I could use? I need a function 
that takes a variable of any type and returns a numeric hash.
Aug 07 2016
next sibling parent Ilya Yaroshenko <ilyayaroshenko gmail.com> writes:
On Sunday, 7 August 2016 at 16:42:47 UTC, Gary Willoughby wrote:
 I need a  nogc version of hashOf(). Here's one i'm currently 
 using but it's not marked as  nogc.

 https://github.com/dlang/druntime/blob/master/src/object.d#L3170

 What are the options now?

 Is there anything D offers that I could use? I need a function 
 that takes a variable of any type and returns a numeric hash.
Current DMD master has MurmurHash3 digest.
Aug 07 2016
prev sibling parent reply ag0aep6g <anonymous example.com> writes:
On 08/07/2016 06:42 PM, Gary Willoughby wrote:
 I need a  nogc version of hashOf(). Here's one i'm currently using but
 it's not marked as  nogc.

 https://github.com/dlang/druntime/blob/master/src/object.d#L3170
That seems to be an oversight. https://github.com/dlang/druntime/pull/1624
Aug 07 2016
parent reply ag0aep6g <anonymous example.com> writes:
On 08/07/2016 07:10 PM, ag0aep6g wrote:
 https://github.com/dlang/druntime/pull/1624
Has been merged. Is going to be part of 2.072.
Aug 07 2016
parent Gary Willoughby <dev nomad.so> writes:
On Sunday, 7 August 2016 at 18:37:19 UTC, ag0aep6g wrote:
 On 08/07/2016 07:10 PM, ag0aep6g wrote:
 https://github.com/dlang/druntime/pull/1624
Has been merged. Is going to be part of 2.072.
Very cool! MurmurHash3 is a great addition too. Thanks guys.
Aug 07 2016