The Dlang Bot
be16aba1cf
Merge pull request #7436 from n8sh/issue-20723
...
std.random.unpredictableSeed: on x86/x86-64 try using RDRAND when there is no arc4random
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-04-16 20:35:57 +02:00
Geod24
04f3979317
Replace 'Issue XXX' with Bugzilla links
...
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Nathan Sashihara
f6a3678adc
Fix Issue 20723 - std.random.unpredictableSeed: on x86/x86-64 try using RDRAND when there is no arc4random
...
This code works in both DMD and LDC because LDC version 1.20.0
added support for data directives in DMD-style inline asm.
2020-04-06 21:57:13 -07:00
Jacob Carlborg
d7e574e964
Use arc4random
on iOS derived platforms
2020-03-14 15:08:54 +01:00
Adam D. Ruppe
ae93f5317c
Use consistent quickindex wrapper around hand-written list-of-links tables
2020-02-21 21:04:05 -05:00
Nathan Sashihara
67e4a08684
Issue 20548 followup: in 32-bit builds RandomCoverChoices allocates more memory than needed for the bit vector
2020-02-03 02:00:30 -08:00
Nathan Sashihara
9014d77ab0
Fix Issue 20548 - Use bit vector instead of bool[] in RandomCover when choices cannot be packed in a single word
2020-01-30 23:15:57 -08:00
Alexandru Militaru
bb62aaca3d
Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest
2020-01-19 14:05:17 +02:00
Bernhard Seckinger
97abb91952
Fix Issue 10902 - some phobos unittests take an excessive amount of time
2019-11-12 20:21:03 +01:00
Mike
b3416948d9
Replace sizediff_t
with ptrdiff_t
in std.random.d
2019-08-30 17:38:39 +09:00
Martin Nowak
b42d6291ab
Merge remote-tracking branch 'upstream/stable' into merge_stable
2019-06-13 01:06:21 +02:00
Nicholas Wilson
5e72cf5c1d
Merge pull request #7013 from n8sh/rndGenUnusedImports
...
Remove unused imports from std.random.rndGen
2019-05-18 13:48:34 +08:00
Nathan Sashihara
e4a38e8ea5
Remove unused imports from std.random.rndGen
2019-05-17 19:49:58 -04:00
Nathan Sashihara
8d49976514
Issue 19836 followup - also fix on 32 bit machines
...
Changed the private enhanced seeding method for `rndGen` to something
that is fast on both 64 bit and 32 bit machines so can be enabled
regardless of architecture. When compiled with LDC it is about 1.35x
the speed of public `Mt19937.seed(uint)`.
2019-05-06 05:13:56 -04:00
Nathan Sashihara
b7389926ee
Fix Issue 19837 - std.random.isUniformRNG(Rng, ElementType) should not require Rng.front to be annotated @property
2019-04-29 10:03:45 -04:00
Nathan Sashihara
5d0f1d3471
Fix Issue 19836 - Excessive probability of UUID collisions in std.uuid.randomUUID
...
On 64-bit architectures use 64 bits of entropy to initialize
thread-local `rndGen`.
The motivation for this change is std.uuid defaults to using `rndGen`
to generate UUIDs. If every `rndGen` starts in one of 2^^32 states then
if 77000 independent programs each generate a single UUID there is a 50%
chance that at least two of them generate the same initial UUID (and all
subsequent UUIDs would be identical as well). Not just Phobos but also
C++ boost::uuids::random_generator defaults to generating UUIDs with a
Mersenne Twister initialized from a 32-bit seed, exacerbating the
collision problem further. If instead there are 2^^64 possible initial
states of `rndGen` there can be over 5 billion independent `rndGen`s
before there is a 50% chance of two having identical initial states.
This change is limited to 64-bit architectures to avoid a measurable
performance decrease, because many programs are not generating UUIDs.
2019-04-28 16:16:11 -04:00
Rainer Schuetze
2e13c10025
add workaround for https://issues.dlang.org/show_bug.cgi?id=2396 to reduce compile time of unittests
2019-03-29 12:12:53 +01:00
Nathan Sashihara
25300d32d1
Fix issue 15853 - std.random save methods must be const
...
Revival of dlang/phobos#4136
2019-02-08 16:52:20 -05:00
Nathan Sashihara
21120a4972
Fix Issue 19580 - [non-DMD] std.random seed bootstrap: don't count on reading an uninitialized variable being treated as an ordinary read
2019-01-14 02:05:04 -05:00
Walter Bright
233d7d617f
std.random: make dip1000 compliant
2019-01-10 03:33:08 -08:00
Nathan Sashihara
dc1a3d3efa
Fix Issue 18680 - std.random.LinearCongruentialEngine has opEquals but no toHash
...
The custom opEquals is unnecessary. Autogenerated struct equals is correct.
2018-11-21 15:05:48 -05:00
Nathan Sashihara
dcca23edca
Fix Issue 19164 - malloc may be considered pure when failure results in program exit (no need to reset errno)
2018-11-17 17:00:16 -05:00
The Dlang Bot
ac2c7c627d
Merge pull request #6424 from n8sh/xorshift-18327
...
Fix Issue 18327 - std.random.XorshiftEngine is parameterized by UIntType but only works with uint
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2018-11-15 16:49:25 +01:00
Nathan Sashihara
c75d6f712a
Fix Issue 18595 & Issue 18596: replace MindstdRand0 w/SplitMix & templatize unpredictableSeed!UIntType
2018-11-14 05:40:48 -05:00
ARaspiK
9bb605b8d1
Made unittest for rndGen
also nothrow @nogc
...
As requested by @ZombineDev
2018-11-11 08:08:01 +01:00
ARaspiK
3d54b63c5d
Make rndgen
nothrow
...
This passes all Phobos tests and would be really nice for no-exceptions situations, instead of appending `assumeWontThrow` to everything. Should be quick.
2018-11-10 21:47:25 +01:00
Nathan Sashihara
c99a1855f6
Fix Issue 18327 - std.random.XorshiftEngine is parameterized by UIntType but only works with uint
...
Also:
* Add ability to specify shift directions.
* Allow arbitrary XorshiftEngine sizes instead of predefined list only.
* Except when array is small, use index to make speed of `popFront`
independent of array size.
2018-09-24 08:55:00 -04:00
Iain Buclaw
fd5facfe04
posix.mak: Enforce whitespace before opening parenthesis for version conditions
2018-09-22 16:57:24 +02:00
Sebastian Wilzbach
91c9973d72
Merge pull request #6657 from n8sh/std-random-14001-19156
...
Fix Issue 14001 & Issue 19156 - `@nogc` std.random.randomCover and std.random.randomShuffle
2018-08-14 13:54:44 +02:00
Martin Nowak
050464eda6
Merge remote-tracking branch 'upstream/stable' into merge_stable
...
# Conflicts:
# std/conv.d
2018-08-12 16:36:44 +02:00
Nathan Sashihara
3a212c0c72
Fix Issue 14001 - Optionally @nogc
std.random.randomCover
...
Fix Issue 19156 - `@nogc` std.random.randomShuffle
Solution is to use a private `_randomIndex` function that is guaranteed
to be called only with valid bounds.
2018-08-10 18:24:34 -04:00
Martin Kinkelin
4de15cec63
Remove superfluous core.stdc.* dependencies in std.{conv,random}
2018-08-06 21:40:38 +02:00
The Dlang Bot
c7b1cf1994
Merge pull request #6576 from BBasile/rnd-cov-nogc-buff
...
RandomCover use a `@nogc` buffer to store already chosen results
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-07-15 12:25:40 +02:00
Sebastian Wilzbach
84b98fc3f0
Remove invalid Markdown backticks in std.{container,path,random}.d
2018-06-19 22:04:01 +02:00
Basile Burg
a716ad69f1
address review: use memcpy and disable assignment
2018-06-14 07:03:23 +02:00
Basile Burg
d3a933b748
remove wrong ddoc and make disable default ctor
2018-06-13 14:13:34 +02:00
Basile Burg
4b3d0ed23c
address review: make the custom array pure
2018-06-13 07:24:07 +02:00
Basile Burg
047f7272cb
address review: use static OOME and remove useless null check
2018-06-13 06:28:49 +02:00
Basile Burg
76491474ef
cover postblit when heap storage is used
2018-06-12 09:42:01 +02:00
Basile Burg
acb48117d0
fine tweaks
2018-06-11 07:12:25 +02:00
Basile Burg
87a909c147
make impossible to change length and use a var to test if a bit field is used
2018-06-11 06:04:31 +02:00
Basile Burg
395e5e91c4
use a bit packed vector (w/o heap alloc) for small lengths
2018-06-10 21:32:26 +02:00
Basile Burg
a8869e2666
RandomCover use a @nogc
buffer to store already chosen results
2018-06-10 15:26:09 +02:00
Sebastian Wilzbach
c324714fde
Remove a few cases of underscore escaping
2018-06-04 13:05:01 +02:00
Basile Burg
cac1be5408
Annotates std.random unittests with @nogc when already possible
2018-04-21 22:01:19 +02:00
Jack Stouffer
e14f89e170
Make references to input ranges a link to isInputRange
2018-04-08 16:19:57 -04:00
The Dlang Bot
c1fcea4fdf
Merge pull request #6414 from n8sh/remove-unpredictableseed-from-unittests
...
Issue 18715 - Non-documented unittests should not use unpredictableSeed or default Random alias
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-04-05 01:41:30 +02:00
Nathan Sashihara
c1d1c0e874
Issue 18715 - Non-documented unittests should not use unpredictableSeed or default Random alias
2018-04-04 18:08:00 -04:00
Sebastian Wilzbach
152647e985
Add public examples to std.random
2018-04-04 11:42:56 +02:00
Sebastian Wilzbach
42894784dd
Markdownify Phobos
...
$(D word) -> `word`
2018-04-02 22:32:47 +02:00