News for hackers. Stuff that matters.
Re:Emiller's Balls-Out Guide to Nginx Module Development by yosh on Saturday March 27, 2010 @03:43PM (#1223507)
Careful with casting strings to ints like that, it'll break on architectures that require aligned accesses, i.e. if you try to load a uint32, the address of the memory location must be a multiple of 4. x86 happens to be fine with non-aligned access, but many other architectures aren't.

If you look at the nginx source, that #define is guarded under NGX_HAVE_NONALIGNED and there is a fallback that does straight byte by byte comparison.

Re:Emiller's Balls-Out Guide to Nginx Module Development by viraptor on Saturday March 27, 2010 @04:35PM (#1223611)
> fallback that does straight byte by byte comparison

That's not even funny anymore... I wonder how many iterations will it take, until they discover that strncmp compiles down to "repz cmpsb" (or equivalent) and you really cannot do better than that with if-s on each character.

Re:Emiller's Balls-Out Guide to Nginx Module Development by oldgregg on Saturday March 27, 2010 @05:37PM (#1223727)
I like to think I'm a decent programmer.

Then I read threads like this. :o) Keep learning...