Artifact 930b5d7379f92ad16e9e3e72d41a4e3bd601e6a2639bfd14576dd492f84fdf67:
- File kmem/heapao.fn.c — part of check-in [a8d93823f1] at 2019-08-18 13:42:35 on branch trunk — add functions, generate C syscall table (user: lexi, size: 415) [annotate] [blame] [check-ins using]
- File mod/kmem/heapao.fn.c — part of check-in [14172a910a] at 2019-08-21 06:00:24 on branch trunk — move modules to a subdirectory in order to keep the directory tree organized and make room for OS-specific build files (user: lexi, size: 415) [annotate] [blame] [check-ins using]
#include <k/core.h> #include <k/mem.h> /* heapao.fn.c - kmheapao() "allocate heap object" * ~ lexi hale <lexi@hale.su> * kmheapao() allocates a region in heap memory * and returns a kmptr struct referencing that * newly allocated region. */ kmptr kmheapao(sz size) { void* ptr = kmheapa(size); kmptr p = { .kind = (ptr != null ? kmkind_heap : kmkind_fail), .ref = ptr, .shred = false, }; return p; }