diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /malloc/page_begin/main.c | |
Diffstat (limited to 'malloc/page_begin/main.c')
| -rw-r--r-- | malloc/page_begin/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/malloc/page_begin/main.c b/malloc/page_begin/main.c new file mode 100644 index 0000000..8fc931e --- /dev/null +++ b/malloc/page_begin/main.c @@ -0,0 +1,21 @@ +#include <stdio.h> + +#include "page_begin.h" + +static void display_result(void *ptr, size_t page_size, void *expected_result) +{ + void *res = page_begin(ptr, page_size); + + printf("ptr: %p\n", ptr); + printf("page_size: %lu\n", page_size); + printf("expected_result: %p\n", expected_result); + printf("result: %p\n", res); + + printf(expected_result == res ? "OK\n" : "KO\n"); +} + +int main(void) +{ + display_result((void *)0x1234ffea, 4096, (void *)0x1234f000); + display_result((void *)0x1234ffea, 256, (void *)0x1234ff00); +} |
