AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
buddy.h
Go to the documentation of this file.
1#ifndef _DS_BUDDY_H
2#define _DS_BUDDY_H
3
4#include <core/system.h>
5#include <ds/bitmap.h>
6
9struct buddy {
10 size_t first_free_idx; /* where to start looking for a free block */
11 size_t usable; /* how many of its blocks are free */
12 struct bitmap bitmap;
13};
14
15/* The index of a block's buddy: the other half of the block they split
16 * from. */
17#define BUDDY_IDX(idx) ((idx) ^ 0x1)
18
19#endif /* ! _DS_BUDDY_H */
One order of a buddy allocator's zone (mm/buddy.c): a bitmap of its blocks, a set bit for a block tha...
Definition buddy.h:9
size_t usable
Definition buddy.h:11
struct bitmap bitmap
Definition buddy.h:12
size_t first_free_idx
Definition buddy.h:10