|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH] lib/ukswrand: Remove private functions from public API
Hey Roxana, On 11.07.2018 17:36, Roxana Nicolescu wrote: By making the private uk_swrand_init_r and uk_swrand_randr_r functions visible to users, they can call them when they are not allowed to. It was not intended to have uk_swrand_init_r() and uk_swrand_randr_r() private. A use case is to initialize and operate with your own (and maybe multiple random) number generators. Each struct uk_swrand is used as storage to its current state. You may want this to reduce contention (e.g., SMP environments). For convenience, the library initializes one random number generator already during boot. Of course, there are always cases that you should not do with an interface. A clear interface design (e.g., meaningful parameters and fitting data types) and sometimes also description is required. We usually prevent most of this mis-usage with UK_ASSERT() statements. But even here in this particular case, whenever you re-initialize a the number generator, nothing bad happens: It just starts throwing out the same number sequence again.
Btw, without static keyword, you can still link to this symbol. Thanks, Simon _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |