# memory.c File Reference

`#include "magick/studio.h"`
`#include "magick/blob.h"`
`#include "magick/blob-private.h"`
`#include "magick/exception.h"`
`#include "magick/exception-private.h"`
`#include "magick/memory_.h"`
`#include "magick/semaphore.h"`
`#include "magick/string_.h"`

## Data Structures

struct | _DataSegmentInfo
struct | _MemoryInfo

## Defines

#define | BlockFooter(block, size) ((size_t *) ((char *) (block)+(size)-2*sizeof(size_t)))
#define | BlockHeader(block) ((size_t *) (block)-1)
#define | BlockSize 4096
#define | BlockThreshold 1024
#define | MaxBlockExponent 16
#define | MaxBlocks ((BlockThreshold/(4*sizeof(size_t)))+MaxBlockExponent+1)
#define | MaxSegments 1024
#define | MemoryGuard ((0xdeadbeef << 31)+0xdeafdeed)
#define | NextBlock(block) ((char *) (block)+SizeOfBlock(block))
#define | NextBlockInList(block) (*(void **) (block))
#define | PreviousBlock(block) ((char *) (block)-(*((size_t *) (block)-2)))
#define | PreviousBlockBit 0x01
#define | PreviousBlockInList(block) (*((void **) (block)+1))
#define | SegmentSize (2*1024*1024)
#define | SizeMask (~0x01)
#define | SizeOfBlock(block) (*BlockHeader(block) & SizeMask)

## Typedefs

typedef struct _DataSegmentInfo | DataSegmentInfo
typedef struct _MemoryInfo | MemoryInfo

## Functions

MagickExport void * | AcquireMagickMemory (const size_t size)
MagickExport void * | AcquireQuantumMemory (const size_t count, const size_t quantum)
MagickExport void * | CopyMagickMemory (void *destination, const void *source, const size_t size)
MagickExport void | DestroyMagickMemory (void)
MagickExport void * | RelinquishMagickMemory (void *memory)
MagickExport void * | ResetMagickMemory (void *memory, int byte, const size_t size)
MagickExport void * | ResizeMagickMemory (void *memory, const size_t size)
MagickExport void * | ResizeQuantumMemory (void *memory, const size_t count, const size_t quantum)

## Define Documentation

#define BlockFooter | ( | block,
|  | size |  | ) | ((size_t *) ((char *) (block)+(size)-2*sizeof(size_t)))

#define BlockHeader | ( | block |  | ) | ((size_t *) (block)-1)

#define BlockSize 4096

#define BlockThreshold 1024

#define MaxBlockExponent 16

#define MaxBlocks ((BlockThreshold/(4*sizeof(size_t)))+MaxBlockExponent+1)

#define MaxSegments 1024

#define MemoryGuard ((0xdeadbeef << 31)+0xdeafdeed)

#define NextBlock | ( | block |  | ) | ((char *) (block)+SizeOfBlock(block))

#define NextBlockInList | ( | block |  | ) | (*(void **) (block))

#define PreviousBlock | ( | block |  | ) | ((char *) (block)-(*((size_t *) (block)-2)))

#define PreviousBlockBit 0x01

#define PreviousBlockInList | ( | block |  | ) | (*((void **) (block)+1))

#define SegmentSize (2*1024*1024)

#define SizeMask (~0x01)

#define SizeOfBlock | ( | block |  | ) | (*BlockHeader(block) & SizeMask)

## Typedef Documentation

typedef struct _DataSegmentInfo DataSegmentInfo

typedef struct _MemoryInfo MemoryInfo

## Function Documentation

MagickExport void* AcquireMagickMemory | ( | const size_t | size | ) |

MagickExport void* AcquireQuantumMemory | ( | const size_t | count,
|  | const size_t | quantum |
| ) |  |  |

MagickExport void* CopyMagickMemory | ( | void * | destination,
|  | const void * | source,
|  | const size_t | size |
| ) |  |  |

MagickExport void DestroyMagickMemory | ( | void |  | ) |

MagickExport void* RelinquishMagickMemory | ( | void * | memory | ) |

MagickExport void* ResetMagickMemory | ( | void * | memory,
|  | int | byte,
|  | const size_t | size |
| ) |  |  |

MagickExport void* ResizeMagickMemory | ( | void * | memory,
|  | const size_t | size |
| ) |  |  |

MagickExport void* ResizeQuantumMemory | ( | void * | memory,
|  | const size_t | count,
|  | const size_t | quantum |
| ) |  |  |