Frobby  0.9.5
Macros | Typedefs | Variables
stdinc.h File Reference

This header file includes common definitions and is included as the first line of code in every implementation file (.cpp). More...

#include <cstdio>
#include <cstddef>
#include <gmp.h>
#include <gmpxx.h>
#include <memory>

Go to the source code of this file.

Macros

#define IF_DEBUG(X)
 
#define ASSERT(X)
 

Typedefs

typedef unsigned int Exponent
 
typedef unsigned long Word
 The native unsigned type for the CPU. More...
 

Variables

static const size_t BitsPerWord = 8 * sizeof(Word)
 
static const size_t MemoryAlignment = sizeof(long)
 The alignment that memory allocators must ensure. More...
 

Detailed Description

This header file includes common definitions and is included as the first line of code in every implementation file (.cpp).

Thus it is never necessary to include it in headers, and anything defined here is defined everywhere throughout the code base.

Definition in file stdinc.h.

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   X)

Definition at line 86 of file stdinc.h.

◆ IF_DEBUG

#define IF_DEBUG (   X)

Definition at line 85 of file stdinc.h.

Typedef Documentation

◆ Exponent

typedef unsigned int Exponent

Definition at line 89 of file stdinc.h.

◆ Word

typedef unsigned long Word

The native unsigned type for the CPU.

An incorrect type can result in worse performance but all computations must still be correct.

Definition at line 93 of file stdinc.h.

Variable Documentation

◆ BitsPerWord

const size_t BitsPerWord = 8 * sizeof(Word)
static

Definition at line 94 of file stdinc.h.

◆ MemoryAlignment

const size_t MemoryAlignment = sizeof(long)
static

The alignment that memory allocators must ensure.

In other words allocators must return pointer addresses that are divisible by MemoryAlignment. MemoryAlignment must be a power of 2.

Definition at line 99 of file stdinc.h.