PPL Logo

libs/ck-libs/metis/GKlib/mcore.c File Reference

Functions dealing with creating and allocating mcores. More...

Go to the source code of this file.

Functions

gk_mcore_tgk_mcoreCreate (size_t coresize)
gk_mcore_tgk_gkmcoreCreate ()
void gk_mcoreDestroy (gk_mcore_t **r_mcore, int showstats)
void gk_gkmcoreDestroy (gk_mcore_t **r_mcore, int showstats)
void * gk_mcoreMalloc (gk_mcore_t *mcore, size_t nbytes)
void gk_mcorePush (gk_mcore_t *mcore)
void gk_gkmcorePush (gk_mcore_t *mcore)
void gk_mcorePop (gk_mcore_t *mcore)
void gk_gkmcorePop (gk_mcore_t *mcore)
void gk_mcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr)
void gk_gkmcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr)
void gk_mcoreDel (gk_mcore_t *mcore, void *ptr)
void gk_gkmcoreDel (gk_mcore_t *mcore, void *ptr)


Detailed Description

Functions dealing with creating and allocating mcores.

Date:
Started 5/30/11
Author:
George

Copyright 1997-2011, Regents of the University of Minnesota

Version:
Id
mcore.c 13953 2013-03-30 16:20:07Z karypis

Definition in file mcore.c.


Function Documentation

gk_mcore_t* gk_mcoreCreate ( size_t  coresize  ) 

This function creates an mcore

Definition at line 18 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.

Referenced by AllocateWorkSpace().

Here is the call graph for this function:

Here is the caller graph for this function:

gk_mcore_t* gk_gkmcoreCreate (  ) 

This function creates an mcore. This version is used for gkmcore.

Definition at line 43 of file mcore.c.

References gk_mcore_t::cmop, free(), malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.

Referenced by gk_malloc_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_mcoreDestroy ( gk_mcore_t **  r_mcore,
int  showstats 
)

This function destroys an mcore.

Definition at line 67 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_free(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mcore_t::size_callocs, and gk_mcore_t::size_hallocs.

Referenced by FreeWorkSpace().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_gkmcoreDestroy ( gk_mcore_t **  r_mcore,
int  showstats 
)

This function destroys an mcore. This version is for gkmcore.

Definition at line 103 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, and gk_mcore_t::size_hallocs.

Referenced by gk_malloc_cleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

void* gk_mcoreMalloc ( gk_mcore_t mcore,
size_t  nbytes 
)

This function allocate space from the core/heap

Definition at line 140 of file mcore.c.

References gk_mcore_t::core, gk_mcore_t::corecpos, gk_malloc(), and gk_mcoreAdd().

Referenced by wspacemalloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_mcorePush ( gk_mcore_t mcore  ) 

This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes

Definition at line 175 of file mcore.c.

References gk_mcoreAdd().

Referenced by wspacepush().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_gkmcorePush ( gk_mcore_t mcore  ) 

This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes. This is the gkmcore version.

Definition at line 187 of file mcore.c.

References gk_gkmcoreAdd().

Referenced by gk_malloc_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_mcorePop ( gk_mcore_t mcore  ) 

This function frees all mops since the last push

Definition at line 198 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, errexit(), gk_errexit(), gk_free(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.

Referenced by wspacepop().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_gkmcorePop ( gk_mcore_t mcore  ) 

This function frees all mops since the last push. This version is for poping the gkmcore and it uses free instead of gk_free.

Definition at line 237 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.

Referenced by gk_malloc_cleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_mcoreAdd ( gk_mcore_t mcore,
int  type,
size_t  nbytes,
void *  ptr 
)

Adds a memory allocation at the end of the list.

Definition at line 265 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_callocs, gk_mcore_t::size_hallocs, and gk_mop_t::type.

Referenced by gk_mcoreMalloc(), and gk_mcorePush().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_gkmcoreAdd ( gk_mcore_t mcore,
int  type,
size_t  nbytes,
void *  ptr 
)

Adds a memory allocation at the end of the list. This is the gkmcore version.

Definition at line 309 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_hallocs, and gk_mop_t::type.

Referenced by gk_gkmcorePush(), gk_malloc(), and gk_realloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void gk_mcoreDel ( gk_mcore_t mcore,
void *  ptr 
)

This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently.

Definition at line 345 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.

Here is the call graph for this function:

void gk_gkmcoreDel ( gk_mcore_t mcore,
void *  ptr 
)

This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently. This is the gkmcore version.

Definition at line 373 of file mcore.c.

References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.

Referenced by gk_free(), and gk_realloc().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon Sep 21 08:09:04 2020 for Charm++ by  doxygen 1.5.5