Commit db9de7eb authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

rts: Replace `nat` with `uint32_t`

The `nat` type was an alias for `unsigned int` with a comment saying
it was at least 32 bits. We keep the typedef in case client code is
using it but mark it as deprecated.

Test Plan: Validated on Linux, OS X and Windows

Reviewers: simonmar, austin, thomie, hvr, bgamari, hsyl20

Differential Revision: https://phabricator.haskell.org/D2166
parent ad4392c1
......@@ -27,30 +27,30 @@
/* See Note [Synchronization of flags and base APIs] */
typedef struct _GC_FLAGS {
FILE *statsFile;
nat giveStats;
uint32_t giveStats;
#define NO_GC_STATS 0
#define COLLECT_GC_STATS 1
#define ONELINE_GC_STATS 2
#define SUMMARY_GC_STATS 3
#define VERBOSE_GC_STATS 4
nat maxStkSize; /* in *words* */
nat initialStkSize; /* in *words* */
nat stkChunkSize; /* in *words* */
nat stkChunkBufferSize; /* in *words* */
nat maxHeapSize; /* in *blocks* */
nat minAllocAreaSize; /* in *blocks* */
nat largeAllocLim; /* in *blocks* */
nat nurseryChunkSize; /* in *blocks* */
nat minOldGenSize; /* in *blocks* */
nat heapSizeSuggestion; /* in *blocks* */
uint32_t maxStkSize; /* in *words* */
uint32_t initialStkSize; /* in *words* */
uint32_t stkChunkSize; /* in *words* */
uint32_t stkChunkBufferSize; /* in *words* */
uint32_t maxHeapSize; /* in *blocks* */
uint32_t minAllocAreaSize; /* in *blocks* */
uint32_t largeAllocLim; /* in *blocks* */
uint32_t nurseryChunkSize; /* in *blocks* */
uint32_t minOldGenSize; /* in *blocks* */
uint32_t heapSizeSuggestion; /* in *blocks* */
rtsBool heapSizeSuggestionAuto;
double oldGenFactor;
double pcFreeHeap;
nat generations;
nat steps;
uint32_t generations;
uint32_t steps;
rtsBool squeezeUpdFrames;
rtsBool compact; /* True <=> "compact all the time" */
......@@ -97,7 +97,7 @@ typedef struct _DEBUG_FLAGS {
/* See Note [Synchronization of flags and base APIs] */
typedef struct _COST_CENTRE_FLAGS {
nat doCostCentres;
uint32_t doCostCentres;
# define COST_CENTRES_NONE 0
# define COST_CENTRES_SUMMARY 1
# define COST_CENTRES_VERBOSE 2 /* incl. serial time profile */
......@@ -110,7 +110,7 @@ typedef struct _COST_CENTRE_FLAGS {
/* See Note [Synchronization of flags and base APIs] */
typedef struct _PROFILING_FLAGS {
nat doHeapProfile;
uint32_t doHeapProfile;
# define NO_HEAP_PROFILING 0 /* N.B. Used as indexes into arrays */
# define HEAP_BY_CCS 1
# define HEAP_BY_MOD 2
......@@ -121,16 +121,16 @@ typedef struct _PROFILING_FLAGS {
# define HEAP_BY_CLOSURE_TYPE 8
Time heapProfileInterval; /* time between samples */
nat heapProfileIntervalTicks; /* ticks between samples (derived) */
rtsBool includeTSOs;
Time heapProfileInterval; /* time between samples */
uint32_t heapProfileIntervalTicks; /* ticks between samples (derived) */
rtsBool includeTSOs;
rtsBool showCCSOnException;
nat maxRetainerSetSize;
uint32_t maxRetainerSetSize;
nat ccsLength;
uint32_t ccsLength;
const char* modSelector;
const char* descrSelector;
......@@ -184,27 +184,27 @@ typedef struct _MISC_FLAGS {
#ifdef THREADED_RTS
/* See Note [Synchronization of flags and base APIs] */
typedef struct _PAR_FLAGS {
nat nNodes; /* number of threads to run simultaneously */
uint32_t nNodes; /* number of threads to run simultaneously */
rtsBool migrate; /* migrate threads between capabilities */
nat maxLocalSparks;
uint32_t maxLocalSparks;
rtsBool parGcEnabled; /* enable parallel GC */
nat parGcGen; /* do parallel GC in this generation
uint32_t parGcGen; /* do parallel GC in this generation
* and higher only */
rtsBool parGcLoadBalancingEnabled;
rtsBool parGcLoadBalancingEnabled;
/* enable load-balancing in the
* parallel GC */
nat parGcLoadBalancingGen;
uint32_t parGcLoadBalancingGen;
/* do load-balancing in this
* generation and higher only */
nat parGcNoSyncWithIdle;
uint32_t parGcNoSyncWithIdle;
/* if a Capability has been idle for
* this many GCs, do not try to wake
* it up when doing a
* non-load-balancing parallel GC.
* (zero disables) */
nat parGcThreads;
uint32_t parGcThreads;
/* Use this many threads for parallel
* GC (default: use all nNodes). */
......@@ -249,7 +249,7 @@ extern RTS_FLAGS RtsFlags;
/*
* The printf formats are here, so we are less likely to make
* overly-long filenames (with disastrous results). No more than 128
* chars, please!
* chars, please!
*/
#define STATS_FILENAME_MAXLEN 128
......
......@@ -26,7 +26,7 @@ void sendIOManagerEvent (HsWord32 event);
#else
void setIOManagerControlFd (nat cap_no, int fd);
void setIOManagerControlFd (uint32_t cap_no, int fd);
void setTimerManagerControlFd(int fd);
void setIOManagerWakeupFd (int fd);
......
......@@ -200,7 +200,7 @@ void setThreadLocalVar (ThreadLocalKey *key, void *value);
void freeThreadLocalKey (ThreadLocalKey *key);
// Processors and affinity
void setThreadAffinity (nat n, nat m);
void setThreadAffinity (uint32_t n, uint32_t m);
#endif // !CMINUSMINUS
#else
......@@ -221,7 +221,7 @@ int forkOS_createThread ( HsStablePtr entry );
//
// Returns the number of processor cores in the machine
//
nat getNumberOfProcessors (void);
uint32_t getNumberOfProcessors (void);
//
// Support for getting at the kernel thread Id for tracing/profiling.
......
......@@ -42,7 +42,7 @@ typedef StgWord SpinLock;
INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p)
{
StgWord32 r = 0;
nat i;
uint32_t i;
do {
for (i = 0; i < SPIN_COUNT; i++) {
r = cas((StgVolatilePtr)&(p->lock), 1, 0);
......@@ -75,7 +75,7 @@ INLINE_HEADER void initSpinLock(SpinLock * p)
INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p)
{
StgWord32 r = 0;
nat i;
uint32_t i;
do {
for (i = 0; i < SPIN_COUNT; i++) {
r = cas((StgVolatilePtr)p, 1, 0);
......
......@@ -62,7 +62,7 @@ HsBool rtsSupportsBoundThreads (void);
extern unsigned int n_capabilities;
// The number of Capabilities that are not disabled
extern nat enabled_capabilities;
extern uint32_t enabled_capabilities;
#if !IN_STG_CODE
extern Capability MainCapability;
......@@ -72,6 +72,6 @@ extern Capability MainCapability;
// Change the number of capabilities (only supports increasing the
// current value at the moment).
//
extern void setNumCapabilities (nat new_);
extern void setNumCapabilities (uint32_t new_);
#endif /* RTS_THREADS_H */
......@@ -16,7 +16,8 @@
#include <stddef.h>
typedef unsigned int nat; /* at least 32 bits (like int) */
// Deprecated, use uint32_t instead.
typedef unsigned int nat __attribute__((deprecated)); /* uint32_t */
/* ullong (64|128-bit) type: only include if needed (not ANSI) */
#if defined(__GNUC__)
......
......@@ -113,7 +113,7 @@ typedef struct IndexTable_ {
CostCentre *cc;
CostCentreStack *ccs;
struct IndexTable_ *next;
nat back_edge;
uint32_t back_edge;
} IndexTable;
......
......@@ -57,7 +57,7 @@
* own and treat it as an immovable object during GC, expressed as a
* fraction of BLOCK_SIZE.
*/
#define LARGE_OBJECT_THRESHOLD ((nat)(BLOCK_SIZE * 8 / 10))
#define LARGE_OBJECT_THRESHOLD ((uint32_t)(BLOCK_SIZE * 8 / 10))
/*
* Note [integer overflow]
......@@ -295,7 +295,7 @@ void freeChain(bdescr *p);
void freeGroup_lock(bdescr *p);
void freeChain_lock(bdescr *p);
bdescr * splitBlockGroup (bdescr *bd, nat blocks);
bdescr * splitBlockGroup (bdescr *bd, uint32_t blocks);
/* Round a value to megablocks --------------------------------------------- */
......
......@@ -256,20 +256,20 @@ INLINE_HEADER rtsBool LOOKS_LIKE_CLOSURE_PTR (void *p)
Macros for calculating the size of a closure
-------------------------------------------------------------------------- */
EXTERN_INLINE StgOffset PAP_sizeW ( nat n_args );
EXTERN_INLINE StgOffset PAP_sizeW ( nat n_args )
EXTERN_INLINE StgOffset PAP_sizeW ( uint32_t n_args );
EXTERN_INLINE StgOffset PAP_sizeW ( uint32_t n_args )
{ return sizeofW(StgPAP) + n_args; }
EXTERN_INLINE StgOffset AP_sizeW ( nat n_args );
EXTERN_INLINE StgOffset AP_sizeW ( nat n_args )
EXTERN_INLINE StgOffset AP_sizeW ( uint32_t n_args );
EXTERN_INLINE StgOffset AP_sizeW ( uint32_t n_args )
{ return sizeofW(StgAP) + n_args; }
EXTERN_INLINE StgOffset AP_STACK_sizeW ( nat size );
EXTERN_INLINE StgOffset AP_STACK_sizeW ( nat size )
EXTERN_INLINE StgOffset AP_STACK_sizeW ( uint32_t size );
EXTERN_INLINE StgOffset AP_STACK_sizeW ( uint32_t size )
{ return sizeofW(StgAP_STACK) + size; }
EXTERN_INLINE StgOffset CONSTR_sizeW( nat p, nat np );
EXTERN_INLINE StgOffset CONSTR_sizeW( nat p, nat np )
EXTERN_INLINE StgOffset CONSTR_sizeW( uint32_t p, uint32_t np );
EXTERN_INLINE StgOffset CONSTR_sizeW( uint32_t p, uint32_t np )
{ return sizeofW(StgHeader) + p + np; }
EXTERN_INLINE StgOffset THUNK_SELECTOR_sizeW ( void );
......@@ -333,12 +333,12 @@ EXTERN_INLINE StgWord bco_sizeW ( StgBCO *bco )
{ return bco->size; }
/*
* TODO: Consider to switch return type from 'nat' to 'StgWord' #8742
* TODO: Consider to switch return type from 'uint32_t' to 'StgWord' #8742
*
* (Also for 'closure_sizeW' below)
*/
EXTERN_INLINE nat closure_sizeW_ (StgClosure *p, StgInfoTable *info);
EXTERN_INLINE nat
EXTERN_INLINE uint32_t closure_sizeW_ (StgClosure *p, StgInfoTable *info);
EXTERN_INLINE uint32_t
closure_sizeW_ (StgClosure *p, StgInfoTable *info)
{
switch (info->type) {
......@@ -399,8 +399,8 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
}
// The definitive way to find the size, in words, of a heap-allocated closure
EXTERN_INLINE nat closure_sizeW (StgClosure *p);
EXTERN_INLINE nat closure_sizeW (StgClosure *p)
EXTERN_INLINE uint32_t closure_sizeW (StgClosure *p);
EXTERN_INLINE uint32_t closure_sizeW (StgClosure *p)
{
return closure_sizeW_(p, get_itbl(p));
}
......@@ -505,13 +505,13 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n)
#endif
#ifdef PROFILING
void LDV_recordDead (StgClosure *c, nat size);
void LDV_recordDead (StgClosure *c, uint32_t size);
#endif
EXTERN_INLINE void overwritingClosure (StgClosure *p);
EXTERN_INLINE void overwritingClosure (StgClosure *p)
{
nat size, i;
uint32_t size, i;
#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK
// see Note [zeroing slop], also #8402
......@@ -537,10 +537,10 @@ EXTERN_INLINE void overwritingClosure (StgClosure *p)
//
// Note: As this calls LDV_recordDead() you have to call LDV_RECORD()
// on the final state of the closure at the call-site
EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, nat offset);
EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, nat offset)
EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset);
EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset)
{
nat size, i;
uint32_t size, i;
#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK
// see Note [zeroing slop], also #8402
......
......@@ -88,7 +88,7 @@ typedef struct nursery_ {
// memory allocation is tracked.
typedef struct generation_ {
nat no; // generation number
uint32_t no; // generation number
bdescr * blocks; // blocks in this gen
memcount n_blocks; // number of blocks
......@@ -109,9 +109,9 @@ typedef struct generation_ {
struct generation_ *to; // destination gen for live objects
// stats information
nat collections;
nat par_collections;
nat failed_promotions;
uint32_t collections;
uint32_t par_collections;
uint32_t failed_promotions;
// ------------------------------------
// Fields below are used during GC only
......
......@@ -17,8 +17,8 @@ extern W_ mblocks_allocated;
extern void initMBlocks(void);
extern void * getMBlock(void);
extern void * getMBlocks(nat n);
extern void freeMBlocks(void *addr, nat n);
extern void * getMBlocks(uint32_t n);
extern void freeMBlocks(void *addr, uint32_t n);
extern void releaseFreeMemory(void);
extern void freeAllMBlocks(void);
......
......@@ -51,7 +51,7 @@ EXTERN_INLINE StgInfoTable *reallyLockClosure(StgClosure *p)
{
StgWord info;
do {
nat i = 0;
uint32_t i = 0;
do {
info = xchg((P_)(void *)&p->header.info, (W_)&stg_WHITEHOLE_info);
if (info != (W_)&stg_WHITEHOLE_info) return (StgInfoTable *)info;
......
......@@ -137,7 +137,7 @@ createAdjustor (int cconv,
{
ffi_cif *cif;
ffi_type **arg_types;
nat n_args, i;
uint32_t n_args, i;
ffi_type *result_type;
ffi_closure *cl;
int r, abi;
......@@ -251,7 +251,7 @@ static void *
stgAllocStable(size_t size_in_bytes, StgStablePtr *stable)
{
StgArrBytes* arr;
nat data_size_in_words, total_size_in_words;
uint32_t data_size_in_words, total_size_in_words;
/* round up to a whole number of words */
data_size_in_words = ROUNDUP_BYTES_TO_WDS(size_in_bytes);
......
......@@ -63,8 +63,8 @@ void *
arenaAlloc( Arena *arena, size_t size )
{
void *p;
nat size_w;
nat req_blocks;
uint32_t size_w;
uint32_t req_blocks;
bdescr *bd;
// round up to nearest alignment chunk.
......
......@@ -37,8 +37,8 @@
// builds, and for +RTS -N1
Capability MainCapability;
nat n_capabilities = 0;
nat enabled_capabilities = 0;
uint32_t n_capabilities = 0;
uint32_t enabled_capabilities = 0;
// The array of Capabilities. It's important that when we need
// to allocate more Capabilities we don't have to move the existing
......@@ -90,7 +90,7 @@ findSpark (Capability *cap)
Capability *robbed;
StgClosurePtr spark;
rtsBool retry;
nat i = 0;
uint32_t i = 0;
if (!emptyRunQueue(cap) || cap->returning_tasks_hd != NULL) {
// If there are other threads, don't try to run any new
......@@ -175,7 +175,7 @@ findSpark (Capability *cap)
rtsBool
anySparks (void)
{
nat i;
uint32_t i;
for (i=0; i < n_capabilities; i++) {
if (!emptySparkPoolCap(capabilities[i])) {
......@@ -230,9 +230,9 @@ popReturningTask (Capability *cap)
* ------------------------------------------------------------------------- */
static void
initCapability( Capability *cap, nat i )
initCapability( Capability *cap, uint32_t i )
{
nat g;
uint32_t g;
cap->no = i;
cap->in_haskell = rtsFalse;
......@@ -356,10 +356,10 @@ initCapabilities( void )
}
void
moreCapabilities (nat from USED_IF_THREADS, nat to USED_IF_THREADS)
moreCapabilities (uint32_t from USED_IF_THREADS, uint32_t to USED_IF_THREADS)
{
#if defined(THREADED_RTS)
nat i;
uint32_t i;
Capability **old_capabilities = capabilities;
capabilities = stgMallocBytes(to * sizeof(Capability*), "moreCapabilities");
......@@ -399,7 +399,7 @@ moreCapabilities (nat from USED_IF_THREADS, nat to USED_IF_THREADS)
void contextSwitchAllCapabilities(void)
{
nat i;
uint32_t i;
for (i=0; i < n_capabilities; i++) {
contextSwitchCapability(capabilities[i]);
}
......@@ -407,7 +407,7 @@ void contextSwitchAllCapabilities(void)
void interruptAllCapabilities(void)
{
nat i;
uint32_t i;
for (i=0; i < n_capabilities; i++) {
interruptCapability(capabilities[i]);
}
......@@ -721,7 +721,7 @@ void waitForCapability (Capability **pCap, Task *task)
// Try last_free_capability first
cap = last_free_capability;
if (cap->running_task) {
nat i;
uint32_t i;
// otherwise, search for a free capability
cap = NULL;
for (i = 0; i < n_capabilities; i++) {
......@@ -960,7 +960,7 @@ shutdownCapability (Capability *cap USED_IF_THREADS,
rtsBool safe USED_IF_THREADS)
{
#if defined(THREADED_RTS)
nat i;
uint32_t i;
task->cap = cap;
......@@ -1057,7 +1057,7 @@ shutdownCapability (Capability *cap USED_IF_THREADS,
void
shutdownCapabilities(Task *task, rtsBool safe)
{
nat i;
uint32_t i;
for (i=0; i < n_capabilities; i++) {
ASSERT(task->incall->tso == NULL);
shutdownCapability(capabilities[i], task, safe);
......@@ -1084,7 +1084,7 @@ void
freeCapabilities (void)
{
#if defined(THREADED_RTS)
nat i;
uint32_t i;
for (i=0; i < n_capabilities; i++) {
freeCapability(capabilities[i]);
if (capabilities[i] != &MainCapability)
......@@ -1138,7 +1138,7 @@ markCapability (evac_fn evac, void *user, Capability *cap,
void
markCapabilities (evac_fn evac, void *user)
{
nat n;
uint32_t n;
for (n = 0; n < n_capabilities; n++) {
markCapability(evac, user, capabilities[n], rtsFalse);
}
......@@ -1149,7 +1149,7 @@ rtsBool checkSparkCountInvariant (void)
{
SparkCounters sparks = { 0, 0, 0, 0, 0, 0 };
StgWord64 remaining = 0;
nat i;
uint32_t i;
for (i = 0; i < n_capabilities; i++) {
sparks.created += capabilities[i]->spark_stats.created;
......@@ -1176,7 +1176,8 @@ rtsBool checkSparkCountInvariant (void)
#endif
#if !defined(mingw32_HOST_OS)
void setIOManagerControlFd(nat cap_no USED_IF_THREADS, int fd USED_IF_THREADS) {
void
setIOManagerControlFd(uint32_t cap_no USED_IF_THREADS, int fd USED_IF_THREADS) {
#if defined(THREADED_RTS)
if (cap_no < n_capabilities) {
capabilities[cap_no]->io_manager_control_wr_fd = fd;
......
......@@ -34,7 +34,7 @@ struct Capability_ {
StgFunTable f;
StgRegTable r;
nat no; // capability number.
uint32_t no; // capability number.
// The Task currently holding this Capability. This task has
// exclusive access to the contents of this Capability (apart from
......@@ -47,7 +47,7 @@ struct Capability_ {
rtsBool in_haskell;
// Has there been any activity on this Capability since the last GC?
nat idle;
uint32_t idle;
rtsBool disabled;
......@@ -105,7 +105,7 @@ struct Capability_ {
#if defined(THREADED_RTS)
// Worker Tasks waiting in the wings. Singly-linked.
Task *spare_workers;
nat n_spare_workers; // count of above
uint32_t n_spare_workers; // count of above
// This lock protects:
// running_task
......@@ -141,7 +141,7 @@ struct Capability_ {
StgInvariantCheckQueue *free_invariant_check_queues;
StgTRecChunk *free_trec_chunks;
StgTRecHeader *free_trec_headers;
nat transaction_tokens;
uint32_t transaction_tokens;
} // typedef Capability is defined in RtsAPI.h
// We never want a Capability to overlap a cache line with anything
// else, so round it up to a cache line size:
......@@ -192,7 +192,7 @@ void initCapabilities (void);
// Add and initialise more Capabilities
//
void moreCapabilities (nat from, nat to);
void moreCapabilities (uint32_t from, uint32_t to);
// Release a capability. This is called by a Task that is exiting
// Haskell to make a foreign call, or in various other cases when we
......@@ -217,8 +217,8 @@ INLINE_HEADER void releaseCapability_ (Capability* cap STG_UNUSED,
// extern Capability MainCapability;
// declared in includes/rts/Threads.h:
// extern nat n_capabilities;
// extern nat enabled_capabilities;
// extern uint32_t n_capabilities;
// extern uint32_t enabled_capabilities;
// Array of all the capabilities
//
......@@ -260,7 +260,8 @@ extern PendingSync * volatile pending_sync;
//
void waitForCapability (Capability **cap/*in/out*/, Task *task);
EXTERN_INLINE void recordMutableCap (StgClosure *p, Capability *cap, nat gen);
EXTERN_INLINE void recordMutableCap (StgClosure *p, Capability *cap,
uint32_t gen);
EXTERN_INLINE void recordClosureMutated (Capability *cap, StgClosure *p);
......@@ -302,7 +303,7 @@ StgClosure *findSpark (Capability *cap);
rtsBool anySparks (void);
INLINE_HEADER rtsBool emptySparkPoolCap (Capability *cap);
INLINE_HEADER nat sparkPoolSizeCap (Capability *cap);
INLINE_HEADER uint32_t sparkPoolSizeCap (Capability *cap);
INLINE_HEADER void discardSparksCap (Capability *cap);
#else // !THREADED_RTS
......@@ -353,7 +354,7 @@ INLINE_HEADER rtsBool emptyInbox(Capability *cap);
* -------------------------------------------------------------------------- */
EXTERN_INLINE void
recordMutableCap (StgClosure *p, Capability *cap, nat gen)
recordMutableCap (StgClosure *p, Capability *cap, uint32_t gen)
{
bdescr *bd;
......@@ -385,7 +386,7 @@ INLINE_HEADER rtsBool
emptySparkPoolCap (Capability *cap)
{ return looksEmpty(cap->sparks); }
INLINE_HEADER nat
INLINE_HEADER uint32_t
sparkPoolSizeCap (Capability *cap)
{ return sparkPoolSize(cap->sparks); }
......
......@@ -89,7 +89,7 @@ static void searchHeapBlocks (HashTable *addrs, bdescr *bd)
{
StgPtr p;
StgInfoTable *info;
nat size;
uint32_t size;
rtsBool prim;
for (; bd != NULL; bd = bd->link) {
......@@ -275,7 +275,7 @@ static void searchCostCentres (HashTable *addrs, CostCentreStack *ccs)
//
void checkUnload (StgClosure *static_objects)
{
nat g, n;
uint32_t g, n;
HashTable *addrs;
StgClosure* p;
const StgInfoTable *info;
......
......@@ -281,11 +281,11 @@ disInstr ( StgBCO *bco, int pc )
*/
void disassemble( StgBCO *bco )
{
nat i, j;
StgWord16* instrs = (StgWord16*)(bco->instrs->payload);
StgMutArrPtrs* ptrs = bco->ptrs;
nat nbcs = (int)(bco->instrs->bytes / sizeof(StgWord16));
nat pc = 1;
uint32_t i, j;
StgWord16* instrs = (StgWord16*)(bco->instrs->payload);
StgMutArrPtrs* ptrs = bco->ptrs;
uint32_t nbcs = (uint32_t)(bco->instrs->bytes / sizeof(StgWord16));
uint32_t pc = 1;
debugBelch("BCO\n" );
pc = 0;
......
......@@ -45,7 +45,7 @@ static StgStablePtr store[MaxStoreKey];
void
initGlobalStore(void)
{
nat i;
uint32_t i;
for (i=0; i < MaxStoreKey; i++) {
store[i] = 0;
}
......@@ -57,7 +57,7 @@ initGlobalStore(void)
void
exitGlobalStore(void)
{
nat i;
uint32_t i;
#ifdef THREADED_RTS
closeMutex(&globalStoreLock);
#endif
......
......@@ -257,7 +257,7 @@ hs_hpc_module(char *modName,
StgWord64 *tixArr)
{
HpcModuleInfo *tmpModule;
nat i;
uint32_t i;
if (moduleHash == NULL) {
moduleHash = allocStrHashTable();
......@@ -332,12 +332,12 @@ writeTix(FILE *f) {
}
fprintf(f," TixModule \"%s\" %u %u [",
tmpModule->modName,
(nat)tmpModule->hashNo,
(nat)tmpModule->tickCount);
(uint32_t)tmpModule->hashNo,
(uint32_t)tmpModule->tickCount);
debugTrace(DEBUG_hpc,"%s: %u (hash=%u)\n",
tmpModule->modName,
(nat)tmpModule->tickCount,
(nat)tmpModule->hashNo);
(uint32_t)tmpModule->tickCount,
(uint32_t)tmpModule->hashNo);
inner_comma = 0;
for(i = 0;i < tmpModule->tickCount;i++) {
......
......@@ -234,7 +234,7 @@ interpretBCO (Capability* cap)
register StgPtr Sp; // local state -- stack pointer
register StgPtr SpLim; // local state -- stack lim pointer
register StgClosure *tagged_obj = 0, *obj;
nat n, m;
uint32_t n, m;
LOAD_THREAD_STATE();
......@@ -363,7 +363,7 @@ eval_obj:
case AP: /* Copied from stg_AP_entry. */
{
nat i, words;
uint32_t i, words;
StgAP *ap;
ap = (StgAP*)obj;
......@@ -643,7 +643,7 @@ do_apply:
case PAP: {
StgPAP *pap;
nat i, arity;
uint32_t i, arity;
pap = (StgPAP *)obj;
......@@ -722,7 +722,7 @@ do_apply:
}
case BCO: {
nat arity, i;
uint32_t arity, i;