File: kalloc.h

package info (click to toggle)
rapmap 0.15.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,228 kB
  • sloc: cpp: 48,810; ansic: 4,686; sh: 215; python: 82; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef _KALLOC_H_
#define _KALLOC_H_

#include <stdlib.h>

#define km_size(x) (*(((size_t*)(x))-1) * sizeof(size_t))

#ifdef __cplusplus
extern "C" {
#endif

void *kmalloc(void *km, size_t size);
void *krealloc(void *km, void *ptr, size_t size);
void *kcalloc(void *km, size_t count, size_t size);
void kfree(void *km, void *ptr);

void *km_init(void);
void km_destroy(void *km);

void km_stat(const void *km); // TODO: return numbers instead of print to stderr

#ifdef __cplusplus
}
#endif

#endif