SimGrid  3.14.159
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:45

§ 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:276

§ MAP_IS_ANONYMOUS

#define MAP_IS_ANONYMOUS (   MDP)
Value:
(((MDP) -> flags & MMALLOC_ANONYMOUS) \
: 0)
#define MMALLOC_ANONYMOUS
Definition: mmprivate.h:276
#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:276
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op MPI_Win win void int MPI_Datatype void int MPI_Datatype MPI_Comm comm MPI_Aint MPI_Info void baseptr void int MPI_Datatype void int MPI_Datatype MPI_Comm comm MPI_Comm int keyval MPI_Comm int void attr_value void int MPI_Datatype int MPI_Comm comm MPI_Comm int int int int MPI_Comm comm_cart MPI_Comm int int int int coords MPI_Comm int int int int dest MPI_Comm MPI_Comm int result MPI_Comm MPI_Group MPI_Comm newcomm MPI_Comm comm int keyval MPI_Comm int void int flag MPI_Comm MPI_Group group MPI_Comm int void attribute_val MPI_Comm int int MPI_Comm comm_out int int errorclass int flag void baseptr void int MPI_Datatype void int int MPI_Datatype int MPI_Comm comm MPI_Status MPI_Datatype int count char int resultlen void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Win win MPI_Group MPI_Group MPI_Group newgroup MPI_Group group MPI_Group MPI_Group MPI_Group newgroup MPI_Group int int MPI_Group newgroup MPI_Group int size MPI_Group MPI_Group MPI_Group newgroup MPI_Info char key MPI_Info info MPI_Info int nkeys MPI_Info char int int flag int flag int char int int provided void int MPI_Datatype int int MPI_Comm MPI_Request request void int MPI_Datatype int int MPI_Comm MPI_Request request MPI_Copy_function MPI_Delete_function int void extra_state MPI_User_function int MPI_Op op int MPI_Datatype MPI_Comm int size int int MPI_Comm MPI_Status status int provided void int MPI_Datatype int int MPI_Comm MPI_Status status void void int MPI_Datatype MPI_Op MPI_Comm comm void void int MPI_Datatype MPI_Op int MPI_Comm comm void void int MPI_Datatype MPI_Op MPI_Comm comm void int int MPI_Datatype void int MPI_Datatype int MPI_Comm comm void int MPI_Datatype int int int int MPI_Comm MPI_Status status void int MPI_Datatype int int MPI_Comm comm void int MPI_Datatype int int MPI_Comm comm MPI_Request request int MPI_Request int int MPI_Status status int MPI_Request int int MPI_Status statuses int MPI_Datatype MPI_Datatype newtype int int MPI_Aint MPI_Datatype MPI_Datatype new_type int int int MPI_Datatype MPI_Datatype newtype MPI_Type_copy_attr_function MPI_Type_delete_attr_function int void extra_state int int MPI_Aint MPI_Datatype MPI_Datatype newtype MPI_Datatype MPI_Datatype newdatatype int keyval MPI_Datatype int void int flag MPI_Datatype char int len int int MPI_Aint MPI_Datatype MPI_Datatype newtype int int int MPI_Datatype MPI_Datatype newtype MPI_Datatype int void attribute_val MPI_Datatype int size MPI_Datatype MPI_Aint disp void int int void int MPI_Datatype MPI_Comm comm int MPI_Request int MPI_Status status int MPI_Request int int MPI_Status status void MPI_Aint int MPI_Info MPI_Comm MPI_Win win MPI_Win win MPI_Win char int len MPI_Win char name MPI_Win win MPI_Fint datatype MPI_Group group MPI_Op op MPI_Datatype datatype MPI_Fint group MPI_Fint op MPI_Fint win int int errorcode void int int MPI_Datatype void int int MPI_Datatype MPI_Comm comm void int MPI_Datatype int int MPI_Comm comm void int size MPI_Comm int int int int newrank char MPI_Info int MPI_Comm MPI_Comm newcomm char MPI_Info int MPI_Comm MPI_Comm newcomm MPI_Comm MPI_Info MPI_Comm newcomm MPI_Comm MPI_Info info int fd
Definition: smpi_mpi.cpp:232

§ MAP_ANON_OR_OFFSET

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

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)