Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Replace MEMKIND_DEFAULT with MEMKIND_REGULAR #196

Draft
wants to merge 1 commit into
base: 6.0-memkind_alloc_by_size
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/zmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ void zlibc_free(void *ptr) {
#define dallocx(ptr,flags) je_dallocx(ptr,flags)
#elif defined(USE_MEMKIND)
#include <errno.h>
#define malloc(size) memkind_malloc(MEMKIND_DEFAULT,size)
#define calloc(count,size) memkind_calloc(MEMKIND_DEFAULT,count,size)
#define realloc_dram(ptr,size) memkind_realloc(MEMKIND_DEFAULT,ptr,size)
#define malloc(size) memkind_malloc(MEMKIND_REGULAR,size)
#define calloc(count,size) memkind_calloc(MEMKIND_REGULAR,count,size)
#define realloc_dram(ptr,size) memkind_realloc(MEMKIND_REGULAR,ptr,size)
#define realloc_pmem(ptr,size) memkind_realloc(MEMKIND_DAX_KMEM,ptr,size)
#define free_dram(ptr) memkind_free(MEMKIND_DEFAULT,ptr)
#define free_dram(ptr) memkind_free(MEMKIND_REGULAR,ptr)
#define free_pmem(ptr) memkind_free(MEMKIND_DAX_KMEM,ptr)
#endif

Expand Down Expand Up @@ -180,7 +180,7 @@ void *zmalloc_dram(size_t size) {
#ifdef USE_MEMKIND
static int zmalloc_is_pmem(void * ptr) {
struct memkind *temp_kind = memkind_detect_kind(ptr);
return (temp_kind == MEMKIND_DEFAULT) ? DRAM_LOCATION : PMEM_LOCATION;
return (temp_kind == MEMKIND_REGULAR) ? DRAM_LOCATION : PMEM_LOCATION;
}

static void zfree_pmem(void *ptr) {
Expand Down