[m-rev.] for post-commit review; fix system RNG handles for non-unrandom C implementations

Peter Wang novalazy at gmail.com
Sat Feb 20 12:45:07 AEDT 2021


On Sat, 20 Feb 2021 01:11:50 +1100 Julien Fischer <jfischer at opturion.com> wrote:
> 
> Fix system RNG handles for non-urandom C implementations.
> 
> Ensure it is not possible to use a system RNG handle after it has been closed
> with the arc4random() and rand_s() based implementations.
> 
> library/random.system_rng.m:
>      As above.
> 
> Julien.
> 

That's fine.

BTW, I would like to see as much of the code in the C foreign_decl moved
into the foreign_code block, to reduce the amount of #includes that end
up in the .mh file, which would then be (unnecessarily) included in the
C files of any modules that import the system_rng module.
It will require marking foreign_procs with may_not_duplicate to ensure
they aren't opt-exported, but that's fine.

Peter


More information about the reviews mailing list