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/162.c
Gareth Rees 967b61398d Replace mv debug with mvff debug.
Remove some remaining occurrences of mpscvm.h.

Copied from Perforce
 Change: 194865
2018-08-02 14:20:23 +01:00

57 lines
1.1 KiB
C

/*
TEST_HEADER
id = $Id$
summary = MVFF debug fenceposting check: free
language = c
link = testlib.o
OUTPUT_SPEC
assert = true
assertcond = fencepost check on free
END_HEADER
*/
#include "testlib.h"
#include "mpscmvff.h"
#include "mpsavm.h"
void *stackpointer;
mps_arena_t arena;
static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8};
static void test(void) {
mps_thr_t thread;
mps_pool_t pool;
mps_addr_t a;
char * c;
cdie(mps_arena_create(&arena, mps_arena_class_vm(),
(size_t) (1024*1024*50)), "create arena");
cdie(mps_thread_reg(&thread, arena), "register thread");
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_POOL_DEBUG_OPTIONS, &debugOpts);
die(mps_pool_create_k(&pool, arena, mps_class_mv_debug(), args),
"create MVFF pool");
} MPS_ARGS_END(args);
die(mps_alloc(&a, pool, 63), "alloc a");
c = a;
c += 63;
*c = 0;
mps_free(pool, a, 63);
mps_pool_destroy(pool);
mps_thread_dereg(thread);
mps_arena_destroy(arena);
}
int main(void) {
void *m;
stackpointer=&m; /* hack to get stack pointer */
easy_tramp(test);
pass();
return 0;
}