Skip to content
Snippets Groups Projects
Commit 688c8b04 authored by Alex Apostolescu's avatar Alex Apostolescu
Browse files

asg/mem-alloc: Remove block expansion from split-one-block test


Do not test block expansion in malloc=split-one-block.

Signed-off-by: default avatarAlex Apostolescu <alexx.apostolescu@gmail.com>
parent 403f6a30
No related branches found
No related tags found
No related merge requests found
Pipeline #31939 passed
......@@ -10,8 +10,6 @@ os_malloc (['4096'])
os_malloc (['2048']) = HeapStart + 0x1f0c0
os_malloc (['1024']) = HeapStart + 0x1f8e0
os_malloc (['512']) = HeapStart + 0x1fd00
os_malloc (['256']) = HeapStart + 0x1ff20
brk (['HeapStart + 0x20020']) = HeapStart + 0x20020
os_free (['HeapStart + 0x20']) = <void>
os_free (['HeapStart + 0x10040']) = <void>
os_free (['HeapStart + 0x18060']) = <void>
......@@ -20,5 +18,4 @@ os_free (['HeapStart + 0x1e0a0'])
os_free (['HeapStart + 0x1f0c0']) = <void>
os_free (['HeapStart + 0x1f8e0']) = <void>
os_free (['HeapStart + 0x1fd00']) = <void>
os_free (['HeapStart + 0x1ff20']) = <void>
+++ exited (status 0) +++
......@@ -2,13 +2,15 @@
#include "test-utils.h"
#define NUM_SIZES 8
int main(void)
{
int sizes[9];
void *prealloc_ptr, *ptrs[9];
int sizes[NUM_SIZES];
void *prealloc_ptr, *ptrs[NUM_SIZES];
/* Init sizes */
for (int i = 0; i < 9; i++)
for (int i = 0; i < NUM_SIZES; i++)
sizes[i] = MMAP_THRESHOLD / (1 << (i + 1));
/* Create a free block */
......@@ -16,11 +18,11 @@ int main(void)
os_free(prealloc_ptr);
/* Split the chunk multiple times */
for (int i = 0; i < 9; i++)
for (int i = 0; i < NUM_SIZES; i++)
ptrs[i] = os_malloc_checked(sizes[i]);
/* Cleanup */
for (int i = 0; i < 9; i++)
for (int i = 0; i < NUM_SIZES; i++)
os_free(ptrs[i]);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment