spawn many mallocators

This commit is contained in:
Aurel Feer 2022-04-11 00:40:01 +02:00
parent 070b2fe8e4
commit 3e2ee555f8
2 changed files with 10 additions and 6 deletions

View File

@ -2,12 +2,16 @@
#include <test_helper.h>
#include <spawn/spawn.h>
#define PROCESS_COUNT 100
void do_test_threads(void) {
debug_printf("[do_test_threads]\n");
struct spawninfo *si = malloc(sizeof(struct spawninfo));
domainid_t *pid = malloc(sizeof(domainid_t));
struct spawninfo *si = malloc(PROCESS_COUNT * sizeof(struct spawninfo));
domainid_t *pid = malloc(PROCESS_COUNT * sizeof(domainid_t));
CHECK_ERR(spawn_load_by_name("mallocator", si, pid));
for(uint i = 0; i < PROCESS_COUNT; ++i) {
debug_printf("TEST_THREADS: spawn %u\n", i);
CHECK_ERR(spawn_load_by_name("mallocator", &(si[i]), &(pid[i])));
}
}

View File

@ -26,8 +26,8 @@ int main(int argc, char *argv[])
//allocate a 256 MiB buffer
char * big_buf = malloc(1<<28);
big_buf[0] = 'a';
for (int i = 0; i < (1 << 14); i += 4096) {
printf("%x\n", i);
for (int i = 0; i < (1 << 16); i += 4096) {
debug_printf("%x\n", i);
big_buf[i] = 'b';
}
}