Skip to content

Commit

Permalink
Add interface for shmem_malloc_with_hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
yfguo committed Jun 10, 2022
1 parent 853bdf5 commit 909b98b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/shmem.h.in.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ typedef struct {
#define SHMEM_TEAM_SHARED (shmem_team_t) 0x90001
#define SHMEM_TEAM_INVALID NULL

/* SHMEM malloc hints */
#define SHMEM_MALLOC_ATOMICS_REMOTE 0x002001L
#define SHMEM_MALLOC_SIGNAL_REMOTE 0x002002L

/* Context option constants (long) and type */
#define SHMEM_CTX_SERIALIZED 0x001001L
#define SHMEM_CTX_PRIVATE 0x001002L
Expand Down Expand Up @@ -165,6 +169,7 @@ void *shmem_malloc(size_t size);
void shmem_free(void *ptr);
void *shmem_realloc(void *ptr, size_t size);
void *shmem_align(size_t alignment, size_t size);
void *shmem_malloc_with_hints(size_t size, long hints);
void *shmem_calloc(size_t count, size_t size);
/* (deprecated APIs) */
void *shmalloc(size_t size);
Expand Down
6 changes: 6 additions & 0 deletions src/shmem/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ void *shmem_align(size_t alignment, size_t size)
return ptr;
}

void *shmem_malloc_with_hints(size_t size, long hints)
{
OSHMPI_ASSERT(0);
return NULL;
}

void *shmem_calloc(size_t count, size_t size)
{
void *ptr = NULL;
Expand Down

0 comments on commit 909b98b

Please sign in to comment.