SimGrid  3.16
Versatile Simulation of Distributed Systems
mdesc Struct Reference

Detailed Description

Descriptor of a mmalloc area.

Internal structure that defines the format of the malloc-descriptor. This gets written to the base address of the region that mmalloc is managing, and thus also becomes the file header for the mapped file, if such a file exists.

#include <mmprivate.h>

Public Attributes

pthread_mutex_t mutex
 Mutex locking the access to the heap. More...
 
unsigned int refcount
 Number of processes that attached the heap. More...
 
struct mdescnext_mdesc
 Chained lists of mdescs. More...
 
char magic [MMALLOC_MAGIC_SIZE]
 The "magic number" for an mmalloc file. More...
 
unsigned int headersize
 The size in bytes of this structure. More...
 
unsigned char version
 Version number of the mmalloc package that created this file. More...
 
unsigned int options
 
unsigned int flags
 Some flag bits to keep track of various internal things. More...
 
size_t heapsize
 Number of info entries. More...
 
voidheapbase
 Pointer to first block of the heap (base of the first block). More...
 
size_t heapindex
 Current search index for the heap table. More...
 
size_t heaplimit
 Limit of valid info table indices. More...
 
malloc_infoheapinfo
 Block information table. More...
 
s_xbt_swag_t fraghead [BLOCKLOG]
 
voidbase
 
voidbreakval
 End of memory in use. More...
 
voidtop
 End of the current memory region for this malloc heap. More...
 
int fd
 Open file descriptor for the file to which this malloc heap is mapped. More...
 
struct mstats heapstats
 

Member Data Documentation

◆ mutex

pthread_mutex_t mdesc::mutex

Mutex locking the access to the heap.

◆ refcount

unsigned int mdesc::refcount

Number of processes that attached the heap.

◆ next_mdesc

struct mdesc* mdesc::next_mdesc

Chained lists of mdescs.

◆ magic

char mdesc::magic[MMALLOC_MAGIC_SIZE]

The "magic number" for an mmalloc file.

◆ headersize

unsigned int mdesc::headersize

The size in bytes of this structure.

Used as a sanity check when reusing a previously created mapped file.

◆ version

unsigned char mdesc::version

Version number of the mmalloc package that created this file.

◆ options

unsigned int mdesc::options

◆ flags

unsigned int mdesc::flags

Some flag bits to keep track of various internal things.

◆ heapsize

size_t mdesc::heapsize

Number of info entries.

◆ heapbase

void* mdesc::heapbase

Pointer to first block of the heap (base of the first block).

◆ heapindex

size_t mdesc::heapindex

Current search index for the heap table.

Search index in the info table.

◆ heaplimit

size_t mdesc::heaplimit

Limit of valid info table indices.

◆ heapinfo

malloc_info* mdesc::heapinfo

Block information table.

Table indexed by block number giving per-block information.

◆ fraghead

s_xbt_swag_t mdesc::fraghead[BLOCKLOG]

◆ base

void* mdesc::base

◆ breakval

void* mdesc::breakval

End of memory in use.

Some memory might be already mapped by the OS but not used by the heap.

◆ top

void* mdesc::top

End of the current memory region for this malloc heap.

This is the first location past the end of mapped memory.

Compared to breakval, this value is rounded to the next memory page.

◆ fd

int mdesc::fd

Open file descriptor for the file to which this malloc heap is mapped.

If this value is negative, MAP_ANONYMOUS memory is used.

Also note that it may change each time the region is mapped and unmapped.

◆ heapstats

struct mstats mdesc::heapstats

The documentation for this struct was generated from the following file: