MEMKIND_MEMTIER(3)

πŸ“¦ version 1.13.0, in ubuntu jammy

πŸ’– MEMKIND_MEMTIER πŸ’–

okay bestie, sit DOWN, because we're talking about memkind_memtier(3) β€” the memory tiering interface, manual page MEMKIND_MEMTIER(3). yes it's giving very "big girl API" and yes you're gonna understand all of it.

heads up, this one's a Note: memkind_memtier.h functionality is considered as stable API (STANDARD API). so like, it's not experimental, it's not going anywhere, it's the real deal. 🫢


✨ SYNOPSIS ✨

#include <memkind_memtier.h>

Link with -lmemkind

TIER MANAGEMENT:

struct memtier_builder *memtier_builder_new(memtier_policy_t policy);
void memtier_builder_delete(struct memtier_builder *builder);
int memtier_builder_add_tier(struct memtier_builder *builder, memkind_t kind, unsigned kind_ratio);
struct memtier_memory *memtier_builder_construct_memtier_memory(struct memtier_builder *builder);
void memtier_delete_memtier_memory(struct memtier_memory *memory);

HEAP MANAGEMENT:
void *memtier_malloc(struct memtier_memory *memory, size_t size);
void *memtier_kind_malloc(memkind_t kind, size_t size);
void *memtier_calloc(struct memtier_memory *memory, size_t num, size_t size);
void *memtier_kind_calloc(memkind_t kind, size_t num, size_t size);
void *memtier_realloc(struct memtier_memory *memory, void *ptr, size_t size);
void *memtier_kind_realloc(memkind_t kind, void *ptr, size_t size);
int memtier_posix_memalign(struct memtier_memory *memory, void **memptr, size_t alignment, size_t size);
int memtier_kind_posix_memalign(memkind_t kind, void **memptr, size_t alignment, size_t size);
size_t memtier_usable_size(void *ptr);
void memtier_free(void *ptr);
void memtier_kind_free(memkind_t kind, void *ptr);
size_t memtier_kind_allocated_size(memkind_t kind);

DECORATORS:
void memtier_kind_malloc_post(memkind_t kind, size_t size, void **result);
void memtier_kind_calloc_post(memkind_t kind, size_t nmemb, size_t size, void **result);
void memtier_kind_posix_memalign_post(memkind_t kind, void **memptr, size_t alignment, size_t size, int *err);
void memtier_kind_realloc_post(memkind_t *kind, void *ptr, size_t size, void **result);
void memtier_kind_free_pre(void **ptr);
void memtier_kind_usable_size_post(void **ptr, size_t size);

MEMTIER PROPERTY MANAGEMENT:
int memtier_ctl_set(struct memtier_builder *builder, const char *name, const void *val);

like. look at that. tier management, heap management, decorators, property management. four whole vibes. πŸ’…


πŸŽ€ CTL API πŸŽ€

TODO β€” no fr, that's what it says. it's a TODO. we love an honest queen. πŸ™ˆ

here's what's actually supported though, with their types, and yes you need all of these exactly:

Supported names (with type):

  • policy.dynamic_threshold.thresholds[ID].val (size_t)
  • policy.dynamic_threshold.thresholds[ID].min (size_t)
  • policy.dynamic_threshold.thresholds[ID].max (size_t)
  • policy.dynamic_threshold.check_cnt (unsigned)
  • policy.dynamic_threshold.trigger (float)
  • policy.dynamic_threshold.degree (float)

πŸ¦‹ DECORATORS πŸ¦‹

if you want the whole ~lore~ on decorators, go read the DECORATORS section of memkind(3). it's all there, more details than you could ever need, iykyk. πŸ“š


🌸 DESCRIPTION 🌸

okay so. this section in the original page is... literally empty. nothing. a void. main character silence. 😭

(not me adding anything here β€” there's nothing in the source to add, and I'm not about to make things up about a stable API. no cap.)


Copyright (C) 2021 Intel Corporation. All rights reserved.


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! ✨ this one came to you from Intel Corporation, dated 2021-03-01, filed under MEMKIND_MEMTIER(3). slay, go allocate something responsibly. πŸ’–πŸŒΈπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from