Skip to content

Commit

Permalink
random.c: adding a "libc" version of random for performance testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Feb 27, 2013
1 parent 1d34523 commit d66fdbb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions extra/random/c/authors.txt
@@ -0,0 +1 @@
John Benediktsson
17 changes: 17 additions & 0 deletions extra/random/c/c.factor
@@ -0,0 +1,17 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license

USING: alien.c-types alien.syntax kernel random ;

IN: random.c

LIBRARY: libc

FUNCTION: int rand ( ) ;

SINGLETON: c-random

M: c-random random-32* drop rand ;

: with-c-random ( quot -- )
[ c-random ] dip with-random ; inline
1 change: 1 addition & 0 deletions extra/random/c/platforms.txt
@@ -0,0 +1 @@
unix

0 comments on commit d66fdbb

Please sign in to comment.