On Sun, Jun 16, 2013 at 2:07 AM, Stephen J. Turnbull <stephen(a)xemacs.org> wrote:
The places where you've used these are correct AFAICT. I
audited the (far larger number of) places you didn't change. ;-)
I will audit all calls to make_integer and make_fixnum in the near future.
> - Uses mp_set_memory_functions with the BSD MP code, if it
> - Eliminates all use of move()/mp_move().
I don't understand these, can't review.
I'm going to revert the second one anyway. I only did that due to a
bug in GMP's implementation of move() that was making it impossible
for me to do any testing. Since anybody with GMP should be using the
native GMP interface anyway, there's no reason to pessimize use of
"real" BSD MP interfaces.
Regarding the implementation of bignum_random, I had two questions.
(1) Could this be a serious drain on the entropy pool? Is it useful
if it isn't?!
It depends on how random numbers are generated with get_random(). If
that uses a pseudorandom number generator (which I believe is the
usual case), then the system's entropy pool is not affected.
(2) Why no seed? In general the ability to seed is useful for
There is a seed. Follow the bouncing ball...
- (random t) is called (fns.c, line 70)
- It calls seed_random() (fns.c, line 84)
- The system random number generator is seeded (sysdep.c, line 3471)
GMP, which has its own random number generator, gets the seed passed
to it via bignum_random_seed(). BSD MP, which does not have its own
random number generator, needs no seeding. The random number
implementation for this case uses the libc random number generator,
which is already seeded, so bignum_random_seed() can be a no-op for
XEmacs-Patches mailing list