OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
malloc.h File Reference
`#include "opal_config.h"`
`#include <stdlib.h>`

Go to the source code of this file.

## Macros
#define | OPAL_MALLOC_DEBUG_LEVEL 2

## Functions
BEGIN_C_DECLS void | opal_malloc_init (void)
| Initialize malloc debug output. More...
void | opal_malloc_finalize (void)
| Shut down malloc debug output. More...
OPAL_DECLSPEC void * | opal_malloc (size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__
OPAL_DECLSPEC void * | opal_calloc (size_t nmembers, size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__
OPAL_DECLSPEC void * | opal_realloc (void *ptr, size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__
OPAL_DECLSPEC void | opal_free (void *addr, const char *file, int line) __opal_attribute_nonnull__(1)
OPAL_DECLSPEC void | opal_malloc_debug (int level)
| Used to set the debug level for malloc debug. More...

## Function Documentation

OPAL_DECLSPEC void opal_malloc_debug | ( | int | level | ) |

Used to set the debug level for malloc debug.

Parameters

  level | The level of debugging (0 = none, 1 = some, 2 = more)

This value defaults to the OPAL_MALLOC_DEBUG_LEVEL.

void opal_malloc_finalize | ( | void |  | ) |

Shut down malloc debug output.

This function is invoked as part of opal_finalize() to shut down the output stream for malloc debug messages.

References OBJ_DESTRUCT, and opal_output_close().

Referenced by opal_finalize_util().

BEGIN_C_DECLS void opal_malloc_init | ( | void |  | ) |

Initialize malloc debug output.

This function is invoked to setup a dedicated output stream for malloc debug functions. It does not (currently) do anything other than that (i.e., no internal accounting for tracking malloc/free statements, etc.).

It is invoked as part of opal_init(). Although this function is not necessary for OPAL_MALLOC() and OPAL_FREE(), it is strong recommended because no output messages – regardless of the malloc debug level set by opal_malloc_debug() – will be displayed unless this function is invoked first.

References opal_output_stream_t::lds_is_debugging, opal_output_stream_t::lds_prefix, opal_output_stream_t::lds_verbose_level, opal_output_stream_t::lds_want_stderr, OBJ_CONSTRUCT, and opal_output_open().

Referenced by opal_init_util().