forked from factor/factor
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
random.c: adding a "libc" version of random for performance testing.
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
John Benediktsson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
unix |