mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 07:11:34 -08:00
1. On w3i6mv, int and long are 32 bits, so these types can't be used to hold a size_t or an mps_word_t. See 26.c, 38.c, 47.c, 66.c, 123.c, 136.c, 164.c, 165.c, 200.c, 203.c, 204.c, 205.c, 206.c, 207.c, 215.c, 223.c. 2. The Windows command line doesn't cope with parentheses. See 170.c. 3. The natural platform alignment is 16 bytes on w3i6mv, so allocations into pools using the default alignment need to be rounded up. See 21.c, 22.c, 203.c, 204.c, 205.c. 4. Microsoft Visual C/C++ is fussy about signed/unsigned comparison. See 226.c. 5. windows.h defines a SIZE macro so you can't use it as a parameter. See 232.c. Copied from Perforce Change: 191569 ServerID: perforce.ravenbrook.com
37 lines
756 B
C
37 lines
756 B
C
/*
|
|
TEST_HEADER
|
|
id = $Id$
|
|
summary = allocate large promise, make it small, repeat
|
|
language = c
|
|
link = testlib.o
|
|
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(&arena, mps_arena_class_vm(), mmqaArenaSIZE), "create");
|
|
|
|
die(mps_pool_create(&pool, arena, mps_class_mv(),
|
|
(size_t)(1024*32), (size_t)(1024*16), (size_t)(1024*256)),
|
|
"create MV pool");
|
|
|
|
for (p=0; p<2000; p++) {
|
|
die(mps_alloc(&q, pool, 1024*1024), "alloc");
|
|
q = (mps_addr_t) ((char *) q + MPS_PF_ALIGN);
|
|
mps_free(pool, q, 256*1024-MPS_PF_ALIGN);
|
|
report("promise", "%i", p);
|
|
}
|
|
}
|
|
|
|
int main(void) {
|
|
easy_tramp(test);
|
|
pass();
|
|
return 0;
|
|
}
|