1
1

* put component struct in it's own file. It requires the inclusion of

ompi_config.h, which can't be included in all the intercept code

This commit was SVN r6865.
Этот коммит содержится в:
Brian Barrett 2005-08-14 02:18:11 +00:00
родитель f68ede1c93
Коммит 22d28075eb
3 изменённых файлов: 48 добавлений и 30 удалений

Просмотреть файл

@ -20,4 +20,5 @@ noinst_LTLIBRARIES = libmca_memory_malloc_hooks.la
# Source code files
libmca_memory_malloc_hooks_la_SOURCES = \
malloc_hooks.c
malloc_hooks.c \
malloc_hooks_component.c

Просмотреть файл

@ -22,35 +22,7 @@
#define __USE_GNU
#include <dlfcn.h>
#include "opal/mca/memory/memory.h"
#include "opal/memory/memory_internal.h"
const opal_memory_base_component_1_0_0_t mca_memory_malloc_hooks_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a memory v1.0.0 component (which also
implies a specific MCA version) */
OPAL_MEMORY_BASE_VERSION_1_0_0,
/* Component name and version */
"malloc_hooks",
OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION,
/* Component open and close functions */
NULL,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
true
},
};
/* Prototypes for our hooks. */
static void opal_mem_free_init_hook (void);
@ -128,7 +100,7 @@ munmap(void* addr, size_t len)
opal_mem_free_release_hook(addr, len);
if (NULL == realmunmap) {
realmunmap = dlsym(RTLD_NEXT, "munmap");
realmunmap = (int (*)(void*, size_t)) dlsym(RTLD_NEXT, "munmap");
}
return realmunmap(addr, len);

Просмотреть файл

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "opal/mca/memory/memory.h"
const opal_memory_base_component_1_0_0_t mca_memory_malloc_hooks_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a memory v1.0.0 component (which also
implies a specific MCA version) */
OPAL_MEMORY_BASE_VERSION_1_0_0,
/* Component name and version */
"malloc_hooks",
OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION,
/* Component open and close functions */
NULL,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
true
},
};