From 8d1827222c9a297e2f3757bc7762f903553aae65 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 10 Nov 2010 09:18:31 -0700 Subject: [PATCH] improve docs in 'interior allocation mode and improve 'interior-atomic --- collects/scribblings/inside/memory.scrbl | 19 +++++++++++-------- collects/tests/plot/contour-out.png | Bin 3817 -> 0 bytes src/racket/gc2/newgc.c | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 collects/tests/plot/contour-out.png diff --git a/collects/scribblings/inside/memory.scrbl b/collects/scribblings/inside/memory.scrbl index 09a571d380..2e5b672c93 100644 --- a/collects/scribblings/inside/memory.scrbl +++ b/collects/scribblings/inside/memory.scrbl @@ -56,12 +56,15 @@ The basic collector allocation functions are: object for future garbage collection (as described in @secref["im:3m"]).} - @item{@cppi{scheme_malloc_allow_interior} --- Allocates a large - array of pointers such that references are allowed into the middle of - the block under 3m, and such pointers prevent the block from being - collected. This procedure is the same as @cppi{scheme_malloc} with - the conservative collector, but in the that case, having @italic{only} - a pointer into the interior will not prevent the array from being + @item{@cppi{scheme_malloc_allow_interior} --- Allocates an array of + pointers such that the array is never moved by the garbage collector + and references are allowed into the middle of the block under 3m (and + pointers to the middle prevent the block from being collected). Use + this procedure sparingly, because small, non-moving objects are + handled less efficiently than movable objects by the 3m collector. + This procedure is the same as @cppi{scheme_malloc} with the + conservative collector, but in the that case, having @italic{only} a + pointer into the interior will not prevent the array from being collected.} @item{@cppi{scheme_malloc_atomic_allow_interior} --- Like @@ -651,13 +654,13 @@ Like @cpp{scheme_malloc}, but in 3m, the type tag determines how the @function[(void* scheme_malloc_allow_interior [size_t n])]{ -Like @cpp{scheme_malloc}, but in 3m, pointers are allowed to +Like @cpp{scheme_malloc}, but in 3m, the object never moves, and pointers are allowed to reference the middle of the object; see @secref["im:memoryalloc"].} @function[(void* scheme_malloc_atomic_allow_interior [size_t n])]{ -Like @cpp{scheme_malloc_atomic}, but in 3m, pointers are allowed to +Like @cpp{scheme_malloc_atomic}, but in 3m, the object never moves, and pointers are allowed to reference the middle of the object; see @secref["im:memoryalloc"].} @function[(char* scheme_strdup diff --git a/collects/tests/plot/contour-out.png b/collects/tests/plot/contour-out.png deleted file mode 100644 index c1d2dc736bc08d64e5b9d9b676ce742f1c4e252d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3817 zcmY+Hc{tSn*T!cIjosLit%f2?S)(HL!N?GjtY0L?k}dll#uC%lHg*ajWD65DlVy@6 zV@pMrtc^8GSwa%;$M5=G&viY|ALpFw+~@ptU-v(+N5)3F9IQgDFc^$O4~sE@!QjNB zI>(GSQog$KuOBUS#s;Q30DvRqKMlYl!4PQe-JYtaQmLgfGDp(Cvh<@HH1iR_z#qKt z(U%zvSRlYZNMOSX>^Olv55VyQXF+gJ6u6^-=NaHF1$<>efIJ9N1|h28ff|Uo3ZgVY zj1Gv?0|Wz*U<{H>L5c-Pvj!P4}yg; zusjWZ%!ADpu(JXF>;ka63pO^u$_kjD2h-DFYzzzzg8qKc-3>ZBL0cQ3QbA)QAd^9T zJ*ce()zzT99F&xRq9Tx=4{~!sRu)K01IfuCApyk4gP0hA$AbqCKyWY!2mn4lz|#}B zxdCTq;NSr4?0~g3u&@B8roh-37#ILOJ)ollG&RB1t3XW+sHy^GWgssPWMzSr6gYDR zpwU276bK3eety8i12{PWD=R=E0RnO4|A^bfZy1dImmWsbG&pZ9AD%TU#g1t|kZfq4&>W|M%aEK>qna z)Fl60dYfP1Tec~IKT#BkJ(Robq0N`{1BCx2vV2tYwX1=I)5L?PO#`6Is&vY}U3Z$8?pGRiCAn)Q+@~DACn6t-3_QF4&65dx`P6|N z<=C8Td$#uQ^AS~jN>z{D;A_wuSPX1^QZB-+jUuKF4+2DP35|U<6rwgcjYqJDxJ7Ec z4ZTtmjts|(A8O?96Q!*eWz9woQxWF>>s`R03e6_h zLDe@p%9i9VM-_e&Kq%IZjTeW_{W}>zg`+Sg=mIO1snz>&DO=&nsNeMAk>-6AwH`sJ zk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_ssnNO{ F{XYXKUMBzm diff --git a/src/racket/gc2/newgc.c b/src/racket/gc2/newgc.c index 13e79149b8..9808bddb86 100644 --- a/src/racket/gc2/newgc.c +++ b/src/racket/gc2/newgc.c @@ -1251,7 +1251,7 @@ void *GC_malloc_array_tagged(size_t s) { return allocate(s, PAGE_TARR void *GC_malloc_atomic(size_t s) { return allocate(s, PAGE_ATOMIC); } void *GC_malloc_atomic_uncollectable(size_t s) { return ofm_malloc_zero(s); } void *GC_malloc_allow_interior(size_t s) { return allocate_medium(s, PAGE_ARRAY); } -void *GC_malloc_atomic_allow_interior(size_t s) { return allocate_big(s, PAGE_ATOMIC); } +void *GC_malloc_atomic_allow_interior(size_t s) { return allocate_medium(s, PAGE_ATOMIC); } void *GC_malloc_tagged_allow_interior(size_t s) { return allocate_medium(s, PAGE_TAGGED); } void *GC_malloc_one_small_dirty_tagged(size_t s) { return fast_malloc_one_small_tagged(s, 1); } void *GC_malloc_one_small_tagged(size_t s) { return fast_malloc_one_small_tagged(s, 0); }