Descriptionruntime: add runtime.cputicks() and seed fastrand with it
This patch adds a function to get the current cpu ticks. This is
deemed to be 'sufficiently random' to use to seed fastrand to mitigate
the algorithmic complexity attacks on the hash table implementation.
On AMD64 we use the RDTSC instruction. For 386, this instruction,
while valid, is not recognized by 8a so I've inserted the opcode by
hand. For ARM, this routine is currently stubbed to return a constant
0 value.
Future work: update 8a to recognize RDTSC.
Fixes issue 2630.
Patch Set 1 #Patch Set 2 : diff -r b7e029136522 http://go.googlecode.com/hg/ #Patch Set 3 : diff -r f79343c8a479 http://go.googlecode.com/hg/ #Patch Set 4 : diff -r f79343c8a479 http://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 5 : diff -r 1b6e7832103e http://go.googlecode.com/hg/ #Patch Set 6 : diff -r 1b6e7832103e http://go.googlecode.com/hg/ #
MessagesTotal messages: 14
|