1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 15:00:45 -08:00
emacs/mps/test/function/21.c
Gareth Rees b742e99f96 Mmqa tests function/{7,21,22}.c now pass on 32-bit platforms.
MMQA tests function/{8,98}.c now pass on 64-bit platforms.

Copied from Perforce
 Change: 194599
2018-07-11 16:24:47 +01:00

40 lines
787 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 "mpscmv.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");
die(mps_pool_create(&pool, arena, mps_class_mv(),
(size_t)(32), (size_t)(16), (size_t)(256)),
"create MV 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;
}