1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00
emacs/mps/test/function/21.c
Gareth Rees 4e8de8d42e Replace deprecatd mv with mvff in test cases.
Delete eventrep and replay modules -- these have been broken for a long time. 

Copied from Perforce
 Change: 194843
2018-08-01 13:10:09 +01:00

38 lines
730 B
C

/*
TEST_HEADER
id = $Id$
summary = allocate large object, free its middle, repeat
language = c
link = testlib.o
parameters = OBJECTS=2000
END_HEADER
*/
#include "testlib.h"
#include "mpscmvff.h"
static void test(void) {
mps_arena_t arena;
mps_pool_t pool;
mps_addr_t q;
int p;
die(mps_arena_create_k(&arena, mps_arena_class_vm(), mps_args_none), "create");
cdie(mps_pool_create_k(&pool, arena, mps_class_mvff(), mps_args_none), "pool");
for (p=0; p<OBJECTS; p++) {
die(mps_alloc(&q, pool, 1024), "alloc");
q = (mps_addr_t) ((char *) q + MPS_PF_ALIGN);
mps_free(pool, q, 256-MPS_PF_ALIGN);
}
mps_pool_destroy(pool);
mps_arena_destroy(arena);
}
int main(void) {
easy_tramp(test);
pass();
return 0;
}