root/oshmem/mca/memheap/ptmalloc/memheap_ptmalloc_component.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. _basic_open
  2. mca_memheap_ptmalloc_component_query
  3. mca_memheap_ptmalloc_component_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2013      Mellanox Technologies, Inc.
   4  *                         All rights reserved.
   5  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   6  *                         reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 #include "oshmem_config.h"
  14 #include "opal/util/output.h"
  15 #include "oshmem/mca/memheap/memheap.h"
  16 #include "oshmem/mca/memheap/base/base.h"
  17 #include "oshmem/mca/memheap/ptmalloc/memheap_ptmalloc.h"
  18 #include "memheap_ptmalloc_component.h"
  19 
  20 static int mca_memheap_ptmalloc_component_close(void);
  21 static int mca_memheap_ptmalloc_component_query(mca_base_module_t **module, 
  22                                                 int *priority);
  23 
  24 static int _basic_open(void);
  25 
  26 mca_memheap_base_component_t mca_memheap_ptmalloc_component = {
  27     .memheap_version = {
  28         MCA_MEMHEAP_BASE_VERSION_2_0_0,
  29 
  30         .mca_component_name= "ptmalloc",
  31         MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
  32                               OSHMEM_RELEASE_VERSION),
  33 
  34         .mca_open_component = _basic_open,
  35         .mca_close_component = mca_memheap_ptmalloc_component_close,
  36         .mca_query_component = mca_memheap_ptmalloc_component_query,
  37     },
  38     .memheap_data = {
  39         /* The component is checkpoint ready */
  40         MCA_BASE_METADATA_PARAM_CHECKPOINT
  41     },
  42     .memheap_init = mca_memheap_ptmalloc_module_init,
  43 };
  44 
  45 /* Open component */
  46 static int _basic_open(void)
  47 {
  48     return OSHMEM_SUCCESS;
  49 }
  50 
  51 /* query component */
  52 static int
  53 mca_memheap_ptmalloc_component_query(mca_base_module_t **module, int *priority)
  54 {
  55     *priority = memheap_ptmalloc.priority;
  56     *module = (mca_base_module_t *)&memheap_ptmalloc.super;
  57     return OSHMEM_SUCCESS;
  58 }
  59 
  60 /*
  61  * This function is automaticaly called from mca_base_components_close.
  62  * It releases the component's allocated memory.
  63  */
  64 int mca_memheap_ptmalloc_component_close()
  65 {
  66     mca_memheap_ptmalloc_finalize();
  67     return OSHMEM_SUCCESS;
  68 }

/* [<][>][^][v][top][bottom][index][help] */