SimGrid  3.16
Versatile Simulation of Distributed Systems
mmorecore.c File Reference
#include "src/internal_config.h"
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <errno.h>
#include "mmprivate.h"

Macros

#define MAP_ANONYMOUS   MAP_ANON
 
#define PAGE_ALIGN(addr)
 
#define MAP_PRIVATE_OR_SHARED(MDP)
 
#define MAP_IS_ANONYMOUS(MDP)
 
#define MAP_ANON_OR_FD(MDP)
 
#define MAP_ANON_OR_OFFSET(MDP, off)
 

Functions

voidmmorecore (struct mdesc *mdp, ssize_t size)
 Add memoty to this heap. More...
 
void__mmalloc_remap_core (xbt_mheap_t mdp)
 

Macro Definition Documentation

◆ MAP_ANONYMOUS

#define MAP_ANONYMOUS   MAP_ANON

◆ PAGE_ALIGN

#define PAGE_ALIGN (   addr)
Value:
(void*) (((long)(addr) + xbt_pagesize - 1) & \
~((long)xbt_pagesize - 1))
int xbt_pagesize
Cache the size of a memory page for the current system.
Definition: xbt_main.cpp:44

◆ MAP_PRIVATE_OR_SHARED

#define MAP_PRIVATE_OR_SHARED (   MDP)
Value:
(( MDP -> flags & MMALLOC_ANONYMOUS) \
? MAP_PRIVATE \
: MAP_SHARED)
#define MMALLOC_ANONYMOUS
Definition: mmprivate.h:275

◆ MAP_IS_ANONYMOUS

#define MAP_IS_ANONYMOUS (   MDP)
Value:
(((MDP) -> flags & MMALLOC_ANONYMOUS) \
: 0)
#define MMALLOC_ANONYMOUS
Definition: mmprivate.h:275
#define MAP_ANONYMOUS
Definition: mmorecore.c:26

◆ MAP_ANON_OR_FD

#define MAP_ANON_OR_FD (   MDP)
Value:
(((MDP) -> flags & MMALLOC_ANONYMOUS) \
? -1 \
: (MDP) -> fd)
#define MMALLOC_ANONYMOUS
Definition: mmprivate.h:275
def fd
Definition: simcalls.py:274

◆ MAP_ANON_OR_OFFSET

#define MAP_ANON_OR_OFFSET (   MDP,
  off 
)
Value:
(((MDP) -> flags & MMALLOC_ANONYMOUS) \
? 0 \
: off)
#define MMALLOC_ANONYMOUS
Definition: mmprivate.h:275

Function Documentation

◆ mmorecore()

void* mmorecore ( struct mdesc mdp,
ssize_t  size 
)

Add memoty to this heap.

Get core for the memory region specified by MDP, using SIZE as the amount to either add to or subtract from the existing region. Works like sbrk(), but using mmap().

It never returns NULL. Instead, it dies verbosely on errors.

Parameters
mdpThe heap
sizeBytes to allocate for this heap (or <0 to free memory from this heap)

◆ __mmalloc_remap_core()

void* __mmalloc_remap_core ( xbt_mheap_t  mdp)