diff --git a/racket/src/ChezScheme/c/alloc.c b/racket/src/ChezScheme/c/alloc.c index bd0b50dce1..9df9226641 100644 --- a/racket/src/ChezScheme/c/alloc.c +++ b/racket/src/ChezScheme/c/alloc.c @@ -696,11 +696,10 @@ ptr S_fxvector(n) iptr n; { } ptr S_bytevector(n) iptr n; { - return S_bytevector2(n, 0); + return S_bytevector2(get_thread_context(), n, 0); } -ptr S_bytevector2(n, immobile) iptr n; IBOOL immobile; { - ptr tc; +ptr S_bytevector2(tc, n, immobile) ptr tc; iptr n; IBOOL immobile; { ptr p; iptr d; if (n == 0) return S_G.null_bytevector; @@ -708,8 +707,6 @@ ptr S_bytevector2(n, immobile) iptr n; IBOOL immobile; { if ((uptr)n > (uptr)maximum_bytevector_length) S_error("", "invalid bytevector size request"); - tc = get_thread_context(); - d = size_bytevector(n); if (immobile) find_room(tc, space_immobile_data, 0, type_typed_object, d, p); diff --git a/racket/src/ChezScheme/c/externs.h b/racket/src/ChezScheme/c/externs.h index 02a3cdffff..5d52cc11d4 100644 --- a/racket/src/ChezScheme/c/externs.h +++ b/racket/src/ChezScheme/c/externs.h @@ -87,7 +87,7 @@ extern ptr S_vector_in PROTO((ptr tc, ISPC s, IGEN g, iptr n)); extern ptr S_vector PROTO((iptr n)); extern ptr S_fxvector PROTO((iptr n)); extern ptr S_bytevector PROTO((iptr n)); -extern ptr S_bytevector2 PROTO((iptr n, IBOOL immobile)); +extern ptr S_bytevector2 PROTO((ptr tc, iptr n, IBOOL immobile)); extern ptr S_null_immutable_vector PROTO((void)); extern ptr S_null_immutable_fxvector PROTO((void)); extern ptr S_null_immutable_bytevector PROTO((void)); diff --git a/racket/src/ChezScheme/c/flushcache.c b/racket/src/ChezScheme/c/flushcache.c index d273363087..6ddcfbef2b 100644 --- a/racket/src/ChezScheme/c/flushcache.c +++ b/racket/src/ChezScheme/c/flushcache.c @@ -27,10 +27,10 @@ typedef struct { static uptr max_gap; -static ptr make_mod_range PROTO((uptr start, uptr end)); +static ptr make_mod_range PROTO((ptr tc, uptr start, uptr end)); -static ptr make_mod_range(uptr start, uptr end) { - ptr bv = S_bytevector(sizeof(mod_range)); +static ptr make_mod_range(ptr tc, uptr start, uptr end) { + ptr bv = S_bytevector2(tc, sizeof(mod_range), 0); mod_range_start(bv) = start; mod_range_end(bv) = end; return bv; @@ -59,7 +59,7 @@ void S_record_code_mod(ptr tc, uptr addr, uptr bytes) { #ifdef DEBUG printf(" record_code_mod new range %x to %x\n", addr, end); fflush(stdout); #endif - CODERANGESTOFLUSH(tc) = S_cons_in(tc, space_new, 0, make_mod_range(addr, end), ls); + CODERANGESTOFLUSH(tc) = S_cons_in(tc, space_new, 0, make_mod_range(tc, addr, end), ls); return; } diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c index 335e69ac5f..e49ed541cd 100644 --- a/racket/src/ChezScheme/c/prim5.c +++ b/racket/src/ChezScheme/c/prim5.c @@ -211,7 +211,7 @@ static ptr s_box_immobile(p) ptr p; { } static ptr s_make_immobile_bytevector(uptr len) { - ptr b = S_bytevector2(len, 1); + ptr b = S_bytevector2(get_thread_context(), len, 1); S_immobilize_object(b); return b; }