From 30779981519a03506e515851a760a1f1f5a98a23 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 30 Jun 2020 15:56:17 -0400 Subject: use consistent MA_ prefix --- test/double-free.c | 6 +++--- test/overflow.c | 2 +- test/realloc.c | 6 +++--- test/underflow.c | 2 +- test/use-after-free.c | 4 ++-- test/zero.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/double-free.c b/test/double-free.c index 73ceff5..6771dee 100644 --- a/test/double-free.c +++ b/test/double-free.c @@ -8,12 +8,12 @@ int main(void) { const char buf[] = "THIS IS A CONSTANT STRING"; - char *ptr = map_malloc(sizeof(buf)); + char *ptr = MA_malloc(sizeof(buf)); memcpy(ptr, buf, sizeof(buf)); printf("%p: %s\n", ptr, ptr); - map_free(ptr); + MA_free(ptr); printf("freed\n"); - map_free(ptr); + MA_free(ptr); printf("freed again\n"); } diff --git a/test/overflow.c b/test/overflow.c index 8bb1681..67da24a 100644 --- a/test/overflow.c +++ b/test/overflow.c @@ -5,7 +5,7 @@ int main(void) { - char *ptr = map_malloc(1); + char *ptr = MA_malloc(1); long pagesize = sysconf(_SC_PAGESIZE); printf("ptr: %p, pagesize %ld\n", ptr, pagesize); ptr[pagesize] = '\0'; diff --git a/test/realloc.c b/test/realloc.c index 8106b1f..f7b33ff 100644 --- a/test/realloc.c +++ b/test/realloc.c @@ -8,15 +8,15 @@ int main(void) { const char buf[] = "THIS IS A CONSTANT STRING"; - char *ptr = map_realloc(NULL, sizeof(buf)); + char *ptr = MA_realloc(NULL, sizeof(buf)); memcpy(ptr, buf, sizeof(buf)); printf("%p: %s\n", ptr, ptr); - ptr = map_realloc(ptr, sizeof(buf) * 2); + ptr = MA_realloc(ptr, sizeof(buf) * 2); memcpy(ptr + sizeof(buf) - 1, buf, sizeof(buf)); printf("%p: %s\n", ptr, ptr); - ptr = map_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE)); + ptr = MA_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE)); memcpy(ptr + (2 * sizeof(buf)) - 2, buf, sizeof(buf)); printf("%p: %s\n", ptr, ptr); } diff --git a/test/underflow.c b/test/underflow.c index f23aa6d..e8cadf5 100644 --- a/test/underflow.c +++ b/test/underflow.c @@ -5,7 +5,7 @@ int main(void) { - char *ptr = map_malloc(1); + char *ptr = MA_malloc(1); long pagesize = sysconf(_SC_PAGESIZE); printf("ptr: %p, pagesize %ld\n", ptr, pagesize); ptr[-1] = '\0'; diff --git a/test/use-after-free.c b/test/use-after-free.c index 4338ed5..c7ae9cb 100644 --- a/test/use-after-free.c +++ b/test/use-after-free.c @@ -8,11 +8,11 @@ int main(void) { const char buf[] = "THIS IS A CONSTANT STRING"; - char *ptr = map_malloc(sizeof(buf)); + char *ptr = MA_malloc(sizeof(buf)); memcpy(ptr, buf, sizeof(buf)); printf("%p: %s\n", ptr, ptr); - map_free(ptr); + MA_free(ptr); printf("freed\n"); printf("%p: %s\n", ptr, ptr); } diff --git a/test/zero.c b/test/zero.c index 7be3ad2..15c0890 100644 --- a/test/zero.c +++ b/test/zero.c @@ -5,7 +5,7 @@ int main(void) { - char *ptr = map_malloc(0); + char *ptr = MA_malloc(0); long pagesize = sysconf(_SC_PAGESIZE); printf("ptr: %p, pagesize %ld\n", ptr, pagesize); ptr[0] = '\0'; -- cgit v1.2.1