18#ifndef MAGICKCORE_RANDOM_PRIVATE_H
19#define MAGICKCORE_RANDOM_PRIVATE_H
21#include "magick/thread-private.h"
23#if defined(__cplusplus) || defined(c_plusplus)
27static inline RandomInfo **DestroyRandomInfoTLS(RandomInfo **random_info)
32 assert(random_info != (RandomInfo **) NULL);
33 for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++)
34 if (random_info[i] != (RandomInfo *) NULL)
35 random_info[i]=DestroyRandomInfo(random_info[i]);
36 return((RandomInfo **) RelinquishAlignedMemory(random_info));
39static inline RandomInfo **AcquireRandomInfoTLS(
void)
50 number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
51 random_info=(RandomInfo **) AcquireAlignedMemory(number_threads,
52 sizeof(*random_info));
53 if (random_info == (RandomInfo **) NULL)
54 ThrowFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed");
55 (void) memset(random_info,0,number_threads*
sizeof(*random_info));
56 for (i=0; i < (ssize_t) number_threads; i++)
57 random_info[i]=AcquireRandomInfo();
61extern MagickExport
unsigned long
62 *GetRandomInfoSeed(RandomInfo *);
64extern MagickExport
double
65 GetRandomInfoNormalize(
const RandomInfo *);
67#if defined(__cplusplus) || defined(c_plusplus)