mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-03 00:50:42 +03:00
Update brace style.
Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
This commit is contained in:
parent
5154ff32ee
commit
c4c2592c83
119 changed files with 2971 additions and 3572 deletions
|
|
@ -97,75 +97,65 @@ double genrand_res53_mix(sfmt_t *ctx);
|
|||
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(SFMT_C_))
|
||||
/* These real versions are due to Isaku Wada */
|
||||
/** generates a random number on [0,1]-real-interval */
|
||||
JEMALLOC_INLINE double to_real1(uint32_t v)
|
||||
{
|
||||
JEMALLOC_INLINE double to_real1(uint32_t v) {
|
||||
return v * (1.0/4294967295.0);
|
||||
/* divided by 2^32-1 */
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1]-real-interval */
|
||||
JEMALLOC_INLINE double genrand_real1(sfmt_t *ctx)
|
||||
{
|
||||
JEMALLOC_INLINE double genrand_real1(sfmt_t *ctx) {
|
||||
return to_real1(gen_rand32(ctx));
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1)-real-interval */
|
||||
JEMALLOC_INLINE double to_real2(uint32_t v)
|
||||
{
|
||||
JEMALLOC_INLINE double to_real2(uint32_t v) {
|
||||
return v * (1.0/4294967296.0);
|
||||
/* divided by 2^32 */
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1)-real-interval */
|
||||
JEMALLOC_INLINE double genrand_real2(sfmt_t *ctx)
|
||||
{
|
||||
JEMALLOC_INLINE double genrand_real2(sfmt_t *ctx) {
|
||||
return to_real2(gen_rand32(ctx));
|
||||
}
|
||||
|
||||
/** generates a random number on (0,1)-real-interval */
|
||||
JEMALLOC_INLINE double to_real3(uint32_t v)
|
||||
{
|
||||
JEMALLOC_INLINE double to_real3(uint32_t v) {
|
||||
return (((double)v) + 0.5)*(1.0/4294967296.0);
|
||||
/* divided by 2^32 */
|
||||
}
|
||||
|
||||
/** generates a random number on (0,1)-real-interval */
|
||||
JEMALLOC_INLINE double genrand_real3(sfmt_t *ctx)
|
||||
{
|
||||
JEMALLOC_INLINE double genrand_real3(sfmt_t *ctx) {
|
||||
return to_real3(gen_rand32(ctx));
|
||||
}
|
||||
/** These real versions are due to Isaku Wada */
|
||||
|
||||
/** generates a random number on [0,1) with 53-bit resolution*/
|
||||
JEMALLOC_INLINE double to_res53(uint64_t v)
|
||||
{
|
||||
JEMALLOC_INLINE double to_res53(uint64_t v) {
|
||||
return v * (1.0/18446744073709551616.0L);
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1) with 53-bit resolution from two
|
||||
* 32 bit integers */
|
||||
JEMALLOC_INLINE double to_res53_mix(uint32_t x, uint32_t y)
|
||||
{
|
||||
JEMALLOC_INLINE double to_res53_mix(uint32_t x, uint32_t y) {
|
||||
return to_res53(x | ((uint64_t)y << 32));
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1) with 53-bit resolution
|
||||
*/
|
||||
JEMALLOC_INLINE double genrand_res53(sfmt_t *ctx)
|
||||
{
|
||||
JEMALLOC_INLINE double genrand_res53(sfmt_t *ctx) {
|
||||
return to_res53(gen_rand64(ctx));
|
||||
}
|
||||
}
|
||||
|
||||
/** generates a random number on [0,1) with 53-bit resolution
|
||||
using 32bit integer.
|
||||
*/
|
||||
JEMALLOC_INLINE double genrand_res53_mix(sfmt_t *ctx)
|
||||
{
|
||||
JEMALLOC_INLINE double genrand_res53_mix(sfmt_t *ctx) {
|
||||
uint32_t x, y;
|
||||
|
||||
x = gen_rand32(ctx);
|
||||
y = gen_rand32(ctx);
|
||||
return to_res53_mix(x, y);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue