Hash computation and TFB

2013-08-06 Thread Luboš Doležel
Hello, hash computation with Toll-Free Bridging is a tricky subject. Do it wrong and you'll get all sorts of trouble, especially with dictionaries, which use hashes a lot. The code in corebase currently dispatches all CFHash() calls on ObjC objects to -hash, which is bad. The following expec

Re: Hash computation and TFB

2013-08-06 Thread Stefan Bidi
I copied the hash algorithm straight out of -base, so they should match. I remember a few months ago Richard was playing around with hash functions and this might be causing some issues, now. I just looked it up, the changes were made on rev 36344. There is another issue... -base allows UTF-8 st

Re: Hash computation and TFB

2013-08-06 Thread Luboš Doležel
Yes, I've just noticed that once I force using UTF-16 in CFStringHash(), then -hash and CFStringHash() give the same value. The question is if it holds for all other bridged types. Until a better/permanent solution is found, do you think the changes forcing UTF-16 in CFStringHash() are accepta

Re: Hash computation and TFB

2013-08-06 Thread David Chisnall
On 6 Aug 2013, at 14:36, Luboš Doležel wrote: > I'm currently having problems implementing IOKit What kernel are you implementing IOKit for?!? David ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Hash computation and TFB

2013-08-06 Thread Richard Frith-Macdonald
On 6 Aug 2013, at 14:30, Stefan Bidi wrote: > I copied the hash algorithm straight out of -base, so they should match. I > remember a few months ago Richard was playing around with hash functions and > this might be causing some issues, now. It wouldn't on a normal setup ... the experimental

Re: Hash computation and TFB

2013-08-06 Thread Stefan Bidi
If the testsuite runs correctly, you can go ahead and apply this patch. If possible, could you add more tests to the testsuite for these particular cases? I don't want to inadvertently mess this up when I go into this code in the future. Based on Richard's answer, I think I was way off base, anyw

Re: Hash computation and TFB

2013-08-06 Thread Luboš Doležel
On Tue, 6 Aug 2013 14:40:58 +0100, David Chisnall wrote: On 6 Aug 2013, at 14:36, Luboš Doležel wrote: I'm currently having problems implementing IOKit What kernel are you implementing IOKit for?!? David Linux :-) It's only a user-space emulation, which uses libudev (for now) and will wr

Re: Hash computation and TFB

2013-08-06 Thread David Chisnall
On 6 Aug 2013, at 14:53, Luboš Doležel wrote: > On Tue, 6 Aug 2013 14:40:58 +0100, David Chisnall wrote: >> On 6 Aug 2013, at 14:36, Luboš Doležel wrote: >> >>> I'm currently having problems implementing IOKit >> >> What kernel are you implementing IOKit for?!? >> >> David > > Linux :-) > It

Re: Hash computation and TFB

2013-08-06 Thread Luboš Doležel
On Tue, 6 Aug 2013 14:56:57 +0100, David Chisnall wrote: On 6 Aug 2013, at 14:53, Luboš Doležel wrote: On Tue, 6 Aug 2013 14:40:58 +0100, David Chisnall wrote: On 6 Aug 2013, at 14:36, Luboš Doležel wrote: I'm currently having problems implementing IOKit What kernel are you implementing

Re: Hash computation and TFB

2013-08-06 Thread David Chisnall
On 6 Aug 2013, at 15:01, Luboš Doležel wrote: > Simple one: I don't use FreeBSD and it doesn't even support my hardware. > Moreover, I've already hopefully wrapped all libc differences, so this is not > an issue anymore. So what do you do, for example, for things that invoke functions from cty

Re: Hash computation and TFB

2013-08-06 Thread Richard Frith-Macdonald
On 6 Aug 2013, at 14:39, Richard Frith-Macdonald wrote: > > On 6 Aug 2013, at 14:30, Stefan Bidi wrote: > >> I copied the hash algorithm straight out of -base, so they should match. I >> remember a few months ago Richard was playing around with hash functions and >> this might be causing

Re: Hash computation and TFB

2013-08-06 Thread Luboš Doležel
On Tue, 6 Aug 2013 15:04:34 +0100, David Chisnall wrote: On 6 Aug 2013, at 15:01, Luboš Doležel wrote: Simple one: I don't use FreeBSD and it doesn't even support my hardware. Moreover, I've already hopefully wrapped all libc differences, so this is not an issue anymore. So what do you do,

Re: Hash computation and TFB

2013-08-06 Thread Stefan Bidi
Richard, Back when I was having a look at hash functions, I actually chose Jenkins' lookup3 as a good replacement. It is also public domain, and has a big and little endian alternative, giving the same results. It is still very fast (much faster than our current one-at-a-time function). The reas

Re: Hash computation and TFB

2013-08-06 Thread Luboš Doležel
Done. I've added a test that check compares hashes of an identical ASCII and UTF-16 string. Luboš On Tue, 6 Aug 2013 08:42:43 -0500, Stefan Bidi wrote: If the testsuite runs correctly, you can go ahead and apply this patch. If possible, could you add more tests to the testsuite for these parti

Re: Hash computation and TFB

2013-08-06 Thread Richard Frith-Macdonald
On 6 Aug 2013, at 15:43, Stefan Bidi wrote: > Richard, > Back when I was having a look at hash functions, I actually chose Jenkins' > lookup3 as a good replacement. It is also public domain, and has a big and > little endian alternative, giving the same results. It is still very fast > (muc

Re: Hash computation and TFB

2013-08-06 Thread Stefan Bidi
It just dawned on me that their website says MurmurHash3 is supposed to be super fast compared to one-at-a-time. Is this not what you saw? I'd be curious as to why this is. This thing does 128-bits at a time, instead of 8/16-bits. On Tue, Aug 6, 2013 at 10:26 AM, Richard Frith-Macdonald < rich

NIB loader: custom views don't draw themselves

2013-08-06 Thread Luboš Doležel
Hi, I come again ask for help with the NIB loader. I've taken the example app from [1], recompiled it for 64-bits and started it up under Darling/GNUstep. It should look like [2], but it actually looks like what you can find attached. The app includes a very simple NSView subclass called MyCusto

Re: NIB loader: custom views don't draw themselves

2013-08-06 Thread Fred Kiefer
I am currently on holidays, but will look into this next week. Hopefully somebody beats me in solving this. Fred On the road Am 06.08.2013 um 22:32 schrieb Luboš Doležel : > Hi, > > I come again ask for help with the NIB loader. I've taken the example > app from [1], recompiled it for 64-bits