From a97e65e7f72e0033c4ea2886212751bef636d3c0 Mon Sep 17 00:00:00 2001 From: Sven Stork Date: Wed, 16 May 2007 13:40:33 +0000 Subject: [PATCH] - export mmap/munmap so the memory manager can intercept this calls This commit was SVN r14665. --- opal/mca/memory/ptmalloc2/Makefile.am | 1 + .../memory/ptmalloc2/opal_ptmalloc2_munmap.c | 3 +- .../memory/ptmalloc2/opal_ptmalloc2_munmap.h | 40 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.h diff --git a/opal/mca/memory/ptmalloc2/Makefile.am b/opal/mca/memory/ptmalloc2/Makefile.am index 21ec06041e..04ac747b82 100644 --- a/opal/mca/memory/ptmalloc2/Makefile.am +++ b/opal/mca/memory/ptmalloc2/Makefile.am @@ -61,6 +61,7 @@ EXTRA_DIST = \ README \ ChangeLog \ lran2.h \ + opal_ptmalloc2_munmap.h \ t-test.h \ t-test1.c \ t-test2.c \ diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.c b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.c index 34745c10d2..186ab70c2c 100644 --- a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.c +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.c @@ -35,10 +35,11 @@ #include "opal/memoryhooks/memory_internal.h" +#include "opal_ptmalloc2_munmap.h" + /* * munmap is always intercepted */ -int opal_mem_free_ptmalloc2_munmap(void *start, size_t length, int from_alloc); #if defined(HAVE___MUNMAP) int __munmap(void* addr, size_t len); #endif diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.h b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.h new file mode 100644 index 0000000000..aabf764df8 --- /dev/null +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_munmap.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2007 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$ + */ + +#ifndef OPAL_PTMALLOC2_MUNMAP_H +#define OPAL_PTMALLOC2_MUNMAP_H + +#include "opal_config.h" + +BEGIN_C_DECLS + +int opal_mem_free_ptmalloc2_munmap(void *start, size_t length, int from_alloc); +void* opal_mem_free_ptmalloc2_mmap(void *start, size_t length, + int prot, int flags, + int fd, off_t offset, + int from_alloc); + +OPAL_DECLSPEC void* mmap(void *start, size_t length, int prot, int flags, + int fd, off_t offset); + +OPAL_DECLSPEC int munmap(void* addr, size_t len); + + +END_C_DECLS + +#endif /* !OPAL_PTMALLOC2_MUNMAP_H */