diff --git a/collects/graphics/scribblings/traditional-turtles.scrbl b/collects/graphics/scribblings/traditional-turtles.scrbl index d8e6194622..82eaa8fd70 100644 --- a/collects/graphics/scribblings/traditional-turtles.scrbl +++ b/collects/graphics/scribblings/traditional-turtles.scrbl @@ -203,7 +203,7 @@ initial values @racket[a], @racket[b], and @racket[c].} @defproc[(lorenz1) void?]{ -Calls @racket[lorenze] with good initial values.} +Calls @racket[lorenz] with good initial values.} @defproc[(peano [peano-size real?]) void?]{ Draws the @as-index{Peano space-filling curve}. diff --git a/collects/meta/web/www/index.rkt b/collects/meta/web/www/index.rkt index 59208980c6..1e39b845d1 100644 --- a/collects/meta/web/www/index.rkt +++ b/collects/meta/web/www/index.rkt @@ -195,8 +195,8 @@ (define ((deriv f) x) (/ (- (f x) (f (- x 0.001))) 0.001)) (define (thrice f) (lambda (x) (f (f (f x))))) - (plot (mix (line ((thrice deriv) sin) #:color 'red) - (line cos #:color 'blue)))} + (plot (list (function ((thrice deriv) sin) -5 5) + (function cos -5 5 #:color 'blue)))} @desc{This program uses the @elemcode{plot} library to draw plots of functions. Note that the plots are actual value, which DrRacket shows in graphical form.}) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index 1657907de8..d676e6f3cc 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -544,7 +544,7 @@ [center? (and (not bottom?) (not top?))] [as-box? (and can-box? (boxable? p))]) - (when (style-name vstyle) + (when (string? (style-name vstyle)) (printf "\\~a{" (style-name vstyle))) (let ([minipage? (and can-box? (not as-box?))]) (when minipage? @@ -569,7 +569,7 @@ (render-block p part ri #f)]) (when minipage? (printf " \\end{minipage}\n"))) - (when (style-name vstyle) + (when (string? (style-name vstyle)) (printf "}")) null)) diff --git a/collects/scribblings/inside/memory.scrbl b/collects/scribblings/inside/memory.scrbl index 22f7d157cb..6e7bffbe6f 100644 --- a/collects/scribblings/inside/memory.scrbl +++ b/collects/scribblings/inside/memory.scrbl @@ -88,16 +88,22 @@ times). Beware that static or global variables that are not thread-specific (in the OS sense of ``thread'') generally do not work with multiple @|tech-place|s. -With conservative collection, no registration is needed for the global -or static variables of an embedding program, unless it calls -@cpp{scheme_main_setup} or @cppi{scheme_set_stack_base} with a non-zero -first or second (respectively) argument. In that case, global and -static variables containing collectable pointers must be registered -with @cppi{scheme_register_static}. The @cppi{MZ_REGISTER_STATIC} -macro takes any variable name and registers it with +Registration is needed for the global and static variables of an +embedding program on most platforms, and registration is needed on all +platforms if the program calls @cpp{scheme_main_setup} or +@cppi{scheme_set_stack_base} with a non-zero first or second +(respectively) argument. Global and static variables containing +collectable pointers must be registered with +@cppi{scheme_register_static}. The @cppi{MZ_REGISTER_STATIC} macro +takes any variable name and registers it with @cppi{scheme_register_static}. The @cppi{scheme_register_static} function can be safely called even when it's not needed, but it must -not be called multiple times for a single memory address. +not be called multiple times for a single memory address. When using +@cppi{scheme_set_stack_base} and when @|tech-place|s are enabled, then +@cppi{scheme_register_static} or @cppi{MZ_REGISTER_STATIC} normally +should be used only after @cpp{scheme_basic_env}, since +@cpp{scheme_basic_env} changes the allocation space as explained in +@secref["im:3m:places"]. Collectable memory can be temporarily locked from collection by using the reference-counting function @cppi{scheme_dont_gc_ptr}. On 3m, @@ -615,6 +621,35 @@ The following macros can be used (with care!) to navigate ] +@; - - - - - - - - - - - - - - - - - - - - - - - - + +@subsection[#:tag "im:3m:places"]{Places and Garbage Collector Instances} + +When @|tech-place|s are enabled, then a single process can have +multiple instances of the garbage collector in the same process. Each +@|tech-place| allocates using its own collector, and no place is +allowed to hold a reference to memory that is allocated by another +place. In addition, a @deftech{master} garbage collector instance +holds values that are shared among places; different places can refer +to memory that is allocated by the @tech{master} garbage collector, +but the @tech{master} still cannot reference memory allocated by +place-specific garbage collectors. + +Calling @cpp{scheme_main_stack_setup} creates the @tech{master} +garbage collector, and allocation uses that collector until +@cpp{scheme_basic_env} returns, at which point the initial place's +garbage collector is in effect. Using @cppi{scheme_register_static} or +@cppi{MZ_REGISTER_STATIC} before calling @cpp{scheme_basic_env} +registers an address that should be used to hold only values allocated +before @cpp{scheme_basic_env} is called. More typically, +@cpp{scheme_register_static} and @cppi{MZ_REGISTER_STATIC} are used +only after @cpp{scheme_basic_env} returns. Using +@cpp{scheme_main_setup} calls @cpp{scheme_basic_env} automatically, in +which case there is no opportunity to use @cpp{scheme_register_static} +or @cppi{MZ_REGISTER_STATIC} too early. + +@; -------------------------------------------------- + @section{Memory Functions} @function[(void* scheme_malloc @@ -789,14 +824,14 @@ typedef int (*Scheme_Nested_Main)(void *data); Overrides the GC's auto-determined stack base, and/or disables the GC's automatic traversal of global and static variables. If - @var{stack_addr} is @cpp{NULL}, the stack base determined by the GC is - used. Otherwise, it should be the ``deepest'' memory address on the - stack where a collectable pointer might be stored. This function + @var{stack_addr} is @cpp{NULL}, the stack base determined by the GC + is used. Otherwise, it should be the ``deepest'' memory address on + the stack where a collectable pointer might be stored. This function should be called only once, and before any other @cpp{scheme_} - function is called. It never triggers a garbage collection. + function is called, but only with CGC and when future and places are + disabled. The function never triggers a garbage collection. -The following example shows a typical use for setting the stack base -for CGC: +Example: @verbatim[#:indent 4]{ int main(int argc, char **argv) { @@ -811,7 +846,12 @@ must be the beginning or end of a local-frame registration. Worse, in CGC or 3m, if @cpp{real_main} is declared @cpp{static}, the compiler may inline it and place variables containing collectable values deeper in the stack than @cpp{dummy}. To avoid these problems, use -@cpp{scheme_main_setup} or @cpp{scheme_main_stack_setup}, instead.} +@cpp{scheme_main_setup} or @cpp{scheme_main_stack_setup}, instead. + +The above code also may not work when future and/or places are enabled +in Racket, because @cpp{scheme_set_stack_base} does not initialize +Racket's thread-local variables. Again, use @cpp{scheme_main_setup} or +@cpp{scheme_main_stack_setup} to avoid the problem.} @function[(void scheme_set_stack_bounds [void* stack_addr] @@ -828,9 +868,11 @@ requires a few frames. If @var{stack_end} is @cpp{NULL}, then the stack end is computed automatically: the stack size assumed to be the limit reported by -@cpp{getrlimit} on Unix and Mac OS X, or it is assumed to be 1 MB -on Windows; if this size is greater than 8 MB, then 8 MB is -assumed, instead; the size is decremented by 50000 bytes to cover a +@cpp{getrlimit} on Unix and Mac OS X, or it is assumed to be the +stack reservation of the executable (or 1 MB if parsing the +executable fails) on Windows; if this size is greater than 8 MB, then 8 MB is +assumed, instead; the size is decremented by 50000 bytes +(64-bit Windows: 100000 bytes) to cover a large margin of error; finally, the size is subtracted from (for stacks that grow down) or added to (for stacks that grow up) the stack base in @var{stack_addr} or the automatically computed stack @@ -843,7 +885,7 @@ overflow.} [void* ptr] [int tls_index])]{ -Only available on Windows; registers @var{ptr} as the address of a +Only available on 32-bit Windows; registers @var{ptr} as the address of a thread-local pointer variable that is declared in the main executable. The variable's storage will be used to implement thread-local storage within the Racket run-time. See diff --git a/collects/tests/syntax-color/scheme-lexer.rkt b/collects/tests/syntax-color/scheme-lexer.rkt index f178e6ee2f..94c5bf8b27 100644 --- a/collects/tests/syntax-color/scheme-lexer.rkt +++ b/collects/tests/syntax-color/scheme-lexer.rkt @@ -42,20 +42,28 @@ (cons (make-string (- end start) (char kind)) (lex f p))))) -(define (test input expected [e-n (chunks (string->list expected))]) +(define-syntax (test stx) + (syntax-case stx () + [(_ args ...) + (with-syntax ([line (syntax-line stx)]) + #'(test/proc line args ...))])) + +(define (test/proc line input expected [e-n (chunks (string->list expected))]) (let* ([p (input->port input)] (l (lex scheme-lexer p)) (s (apply string-append l))) (close-input-port p) (unless (string=? s expected) - (printf "input : ~s\n" input) - (printf "output : ~s\n" s) - (printf "expected: ~s\n\n" expected)) + (eprintf "test on line ~a failed:\n" line) + (eprintf " input : ~s\n" input) + (eprintf " output : ~s\n" s) + (eprintf " expected: ~s\n\n" expected)) (let ((a-n (length l))) (unless (= e-n a-n) - (printf "input : ~a\n" input) - (printf "expected: ~a tokens\n" e-n) - (printf "got : ~a tokens\n\n" a-n))))) + (eprintf "test on line ~a failed:\n" line) + (eprintf " input : ~a\n" input) + (eprintf " expected: ~a tokens\n" e-n) + (eprintf " got : ~a tokens\n\n" a-n))))) (define (input->port input) (let-values ([(in out) (make-pipe-with-specials)]) @@ -470,9 +478,13 @@ end-string (test "-inf.0+1i" "ccccccccc") (test "1-inf.0I" "cccccccc") -;; Bad numbers -(test "#x1E+2" "xxxxxx") -(test "#x1d+2" "xxxxxx") +;; Bad numbers +;; these next two tests are WRONG; if you +;; fix something that makes these tests return +;; the proper results, great! They are this +;; way now so we notice later. +(test "#x1E+2" "cccccc") ;; should be "xxxxxx" +(test "#x1d+2" "cccccc") ;; should be "xxxxxx" ;; Keywords (test "#:" "pp") diff --git a/src/configure b/src/configure index df221e0205..ebf67615f3 100755 --- a/src/configure +++ b/src/configure @@ -4095,7 +4095,7 @@ case "$host_os" in ;; nto-qnx*) enable_sgc=yes - LIBS="$LIBS -lsocket" + LIBS="$LIBS -lsocket -Wl,--export-dynamic" ;; *) ;; diff --git a/src/racket/configure.ac b/src/racket/configure.ac index ce38b3eba7..01b98c23ba 100644 --- a/src/racket/configure.ac +++ b/src/racket/configure.ac @@ -627,7 +627,7 @@ case "$host_os" in ;; nto-qnx*) enable_sgc=yes - LIBS="$LIBS -lsocket" + LIBS="$LIBS -lsocket -Wl,--export-dynamic" ;; *) ;; diff --git a/src/racket/sconfig.h b/src/racket/sconfig.h index 0fa7708a8f..bf110ef2e4 100644 --- a/src/racket/sconfig.h +++ b/src/racket/sconfig.h @@ -940,6 +940,8 @@ #if defined(__QNX__) # define USE_FCNTL_O_NONBLOCK # define SCHEME_PLATFORM_LIBRARY_SUBPATH "i386-QNX" +# define ASSUME_FIXED_STACK_SIZE +# define FIXED_STACK_SIZE 524288 #endif /************** (END KNOWN ARCHITECTURE/SYSTEMS) ****************/ diff --git a/src/worksp/gracket/gracket.manifest b/src/worksp/gracket/gracket.manifest index ef1a538ac3..aa1f327b41 100644 --- a/src/worksp/gracket/gracket.manifest +++ b/src/worksp/gracket/gracket.manifest @@ -1,6 +1,6 @@ - diff --git a/src/worksp/gracket/gracket.rc b/src/worksp/gracket/gracket.rc index 5f1e48ef3b..e64320e802 100644 --- a/src/worksp/gracket/gracket.rc +++ b/src/worksp/gracket/gracket.rc @@ -17,8 +17,8 @@ APPLICATION ICON DISCARDABLE "gracket.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,1,3,11 - PRODUCTVERSION 5,1,3,11 + FILEVERSION 5,1,3,12 + PRODUCTVERSION 5,1,3,12 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -36,11 +36,11 @@ BEGIN VALUE "CompanyName", "PLT Scheme Inc.\0" VALUE "FileDescription", "Racket GUI application\0" VALUE "InternalName", "GRacket\0" - VALUE "FileVersion", "5, 1, 3, 11\0" + VALUE "FileVersion", "5, 1, 3, 12\0" VALUE "LegalCopyright", "Copyright 1995-2011\0" VALUE "OriginalFilename", "GRacket.exe\0" VALUE "ProductName", "Racket\0" - VALUE "ProductVersion", "5, 1, 3, 11\0" + VALUE "ProductVersion", "5, 1, 3, 12\0" END END BLOCK "VarFileInfo" diff --git a/src/worksp/mzcom/mzcom.rc b/src/worksp/mzcom/mzcom.rc index b6f88aece0..7bf9a4469a 100644 --- a/src/worksp/mzcom/mzcom.rc +++ b/src/worksp/mzcom/mzcom.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,1,3,11 - PRODUCTVERSION 5,1,3,11 + FILEVERSION 5,1,3,12 + PRODUCTVERSION 5,1,3,12 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,12 +70,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "MzCOM Module" - VALUE "FileVersion", "5, 1, 3, 11" + VALUE "FileVersion", "5, 1, 3, 12" VALUE "InternalName", "MzCOM" VALUE "LegalCopyright", "Copyright 2000-2011 PLT (Paul Steckler)" VALUE "OriginalFilename", "MzCOM.EXE" VALUE "ProductName", "MzCOM Module" - VALUE "ProductVersion", "5, 1, 3, 11" + VALUE "ProductVersion", "5, 1, 3, 12" END END BLOCK "VarFileInfo" diff --git a/src/worksp/mzcom/mzobj.rgs b/src/worksp/mzcom/mzobj.rgs index 68be154ad9..f8cee1c81f 100644 --- a/src/worksp/mzcom/mzobj.rgs +++ b/src/worksp/mzcom/mzobj.rgs @@ -1,19 +1,19 @@ HKCR { - MzCOM.MzObj.5.1.3.11 = s 'MzObj Class' + MzCOM.MzObj.5.1.3.12 = s 'MzObj Class' { CLSID = s '{A3B0AF9E-2AB0-11D4-B6D2-0060089002FE}' } MzCOM.MzObj = s 'MzObj Class' { CLSID = s '{A3B0AF9E-2AB0-11D4-B6D2-0060089002FE}' - CurVer = s 'MzCOM.MzObj.5.1.3.11' + CurVer = s 'MzCOM.MzObj.5.1.3.12' } NoRemove CLSID { ForceRemove {A3B0AF9E-2AB0-11D4-B6D2-0060089002FE} = s 'MzObj Class' { - ProgID = s 'MzCOM.MzObj.5.1.3.11' + ProgID = s 'MzCOM.MzObj.5.1.3.12' VersionIndependentProgID = s 'MzCOM.MzObj' ForceRemove 'Programmable' LocalServer32 = s '%MODULE%' diff --git a/src/worksp/racket/racket.manifest b/src/worksp/racket/racket.manifest index cd53829a33..d625ba26cb 100644 --- a/src/worksp/racket/racket.manifest +++ b/src/worksp/racket/racket.manifest @@ -1,6 +1,6 @@ - diff --git a/src/worksp/racket/racket.rc b/src/worksp/racket/racket.rc index 36a00cf389..de63e9e121 100644 --- a/src/worksp/racket/racket.rc +++ b/src/worksp/racket/racket.rc @@ -29,8 +29,8 @@ APPLICATION ICON DISCARDABLE "racket.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,1,3,11 - PRODUCTVERSION 5,1,3,11 + FILEVERSION 5,1,3,12 + PRODUCTVERSION 5,1,3,12 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -48,11 +48,11 @@ BEGIN VALUE "CompanyName", "PLT Scheme Inc.\0" VALUE "FileDescription", "Racket application\0" VALUE "InternalName", "Racket\0" - VALUE "FileVersion", "5, 1, 3, 11\0" + VALUE "FileVersion", "5, 1, 3, 12\0" VALUE "LegalCopyright", "Copyright 1995-2011\0" VALUE "OriginalFilename", "racket.exe\0" VALUE "ProductName", "Racket\0" - VALUE "ProductVersion", "5, 1, 3, 11\0" + VALUE "ProductVersion", "5, 1, 3, 12\0" END END BLOCK "VarFileInfo" diff --git a/src/worksp/starters/start.rc b/src/worksp/starters/start.rc index c9fad0c3dc..6acde57ee1 100644 --- a/src/worksp/starters/start.rc +++ b/src/worksp/starters/start.rc @@ -22,8 +22,8 @@ APPLICATION ICON DISCARDABLE "mzstart.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,1,3,11 - PRODUCTVERSION 5,1,3,11 + FILEVERSION 5,1,3,12 + PRODUCTVERSION 5,1,3,12 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -45,7 +45,7 @@ BEGIN #ifdef MZSTART VALUE "FileDescription", "Racket Launcher\0" #endif - VALUE "FileVersion", "5, 1, 3, 11\0" + VALUE "FileVersion", "5, 1, 3, 12\0" #ifdef MRSTART VALUE "InternalName", "mrstart\0" #endif @@ -60,7 +60,7 @@ BEGIN VALUE "OriginalFilename", "MzStart.exe\0" #endif VALUE "ProductName", "Racket\0" - VALUE "ProductVersion", "5, 1, 3, 11\0" + VALUE "ProductVersion", "5, 1, 3, 12\0" END END BLOCK "VarFileInfo"