ffi/unsafe/global: add get-place-table
This commit is contained in:
parent
fb99c0bc57
commit
0ace17a3e9
|
@ -12,7 +12,7 @@
|
|||
|
||||
(define collection 'multi)
|
||||
|
||||
(define version "6.11.0.5")
|
||||
(define version "6.11.0.6")
|
||||
|
||||
(define deps `("racket-lib"
|
||||
["racket" #:version ,version]))
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
@(require "utils.rkt"
|
||||
(for-label ffi/unsafe/global))
|
||||
|
||||
@title{Process-Wide Registration}
|
||||
@title[#:tag "unsafe-global"]{Process-Wide and Place-Wide Registration}
|
||||
|
||||
@defmodule[ffi/unsafe/global]{The
|
||||
@racketmodname[ffi/unsafe/global] library provides a utility
|
||||
registering information that spans all places in the Racket
|
||||
process.}
|
||||
registering information that is local to a place or
|
||||
spans all places in the Racket process.}
|
||||
|
||||
@history[#:added "6.9.0.5"]
|
||||
|
||||
|
@ -28,4 +28,11 @@ installed and the old value is returned. The given @racket[val] must
|
|||
not refer to garbage-collected memory.
|
||||
|
||||
This function is intended for infrequent use with a small number of
|
||||
keys.}
|
||||
keys.}
|
||||
|
||||
@defproc[(get-place-table-global) hash?]{
|
||||
|
||||
Returns a place-specific, mutable, @racket[eq?]-based hash table.
|
||||
The result is always the same for a particular place.
|
||||
|
||||
@history[#:added "6.11.0.6"]}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
#lang racket/base
|
||||
(require (only-in '#%unsafe
|
||||
unsafe-register-process-global))
|
||||
unsafe-register-process-global
|
||||
unsafe-get-place-table))
|
||||
|
||||
(provide register-process-global)
|
||||
(provide register-process-global
|
||||
get-place-table)
|
||||
|
||||
(define (register-process-global bstr val)
|
||||
(unsafe-register-process-global bstr val))
|
||||
|
||||
(define (get-place-table)
|
||||
(unsafe-get-place-table))
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
unsafe-custodian-register
|
||||
unsafe-custodian-unregister
|
||||
unsafe-register-process-global
|
||||
unsafe-get-place-table
|
||||
unsafe-make-security-guard-at-root
|
||||
unsafe-set-on-atomic-timeout!
|
||||
unsafe-abort-current-continuation/no-wind
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define USE_COMPILED_STARTUP 1
|
||||
|
||||
#define EXPECTED_PRIM_COUNT 1161
|
||||
#define EXPECTED_UNSAFE_COUNT 156
|
||||
#define EXPECTED_UNSAFE_COUNT 157
|
||||
#define EXPECTED_FLFXNUM_COUNT 69
|
||||
#define EXPECTED_EXTFL_COUNT 45
|
||||
#define EXPECTED_FUTURES_COUNT 15
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
consistently.)
|
||||
*/
|
||||
|
||||
#define MZSCHEME_VERSION "6.11.0.5"
|
||||
#define MZSCHEME_VERSION "6.11.0.6"
|
||||
|
||||
#define MZSCHEME_VERSION_X 6
|
||||
#define MZSCHEME_VERSION_Y 11
|
||||
#define MZSCHEME_VERSION_Z 0
|
||||
#define MZSCHEME_VERSION_W 5
|
||||
#define MZSCHEME_VERSION_W 6
|
||||
|
||||
#define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y)
|
||||
#define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W)
|
||||
|
|
|
@ -339,6 +339,7 @@ static Scheme_Object *unsafe_custodian_register(int argc, Scheme_Object *argv[])
|
|||
static Scheme_Object *unsafe_custodian_unregister(int argc, Scheme_Object *argv[]);
|
||||
|
||||
static Scheme_Object *unsafe_register_process_global(int argc, Scheme_Object *argv[]);
|
||||
static Scheme_Object *unsafe_get_place_table(int argc, Scheme_Object *argv[]);
|
||||
static Scheme_Object *unsafe_set_on_atomic_timeout(int argc, Scheme_Object *argv[]);
|
||||
|
||||
static Scheme_Object *make_plumber(int argc, Scheme_Object *argv[]);
|
||||
|
@ -651,6 +652,7 @@ scheme_init_unsafe_thread (Scheme_Env *env)
|
|||
GLOBAL_PRIM_W_ARITY("unsafe-custodian-unregister", unsafe_custodian_unregister, 2, 2, env);
|
||||
|
||||
GLOBAL_PRIM_W_ARITY("unsafe-register-process-global", unsafe_register_process_global, 2, 2, env);
|
||||
GLOBAL_PRIM_W_ARITY("unsafe-get-place-table", unsafe_get_place_table, 0, 0, env);
|
||||
|
||||
GLOBAL_PRIM_W_ARITY("unsafe-set-on-atomic-timeout!", unsafe_set_on_atomic_timeout, 1, 1, env);
|
||||
|
||||
|
@ -2789,6 +2791,11 @@ static Scheme_Object *unsafe_register_process_global(int argc, Scheme_Object *ar
|
|||
return scheme_false;
|
||||
}
|
||||
|
||||
static Scheme_Object *unsafe_get_place_table(int argc, Scheme_Object *argv[])
|
||||
{
|
||||
return scheme_get_place_table();
|
||||
}
|
||||
|
||||
void scheme_init_process_globals(void)
|
||||
{
|
||||
#if defined(MZ_USE_MZRT)
|
||||
|
|
Loading…
Reference in New Issue
Block a user