diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-02-14 08:46:55 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-02-14 10:56:58 +0000 |
commit | 7e7a4e4d7e9e84b2c57d3d55e372e738b5f8dbf5 (patch) | |
tree | b5ab2b56418c09f01275970cc7d4e6629b0e7b43 /includes | |
parent | 65a0e1eb88fb48d085f8da498a7acc2fd345c2a8 (diff) | |
download | haskell-7e7a4e4d7e9e84b2c57d3d55e372e738b5f8dbf5.tar.gz |
Separate StablePtr and StableName tables (#7674)
To improve performance of StablePtr.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/HsFFI.h | 4 | ||||
-rw-r--r-- | includes/rts/Stable.h | 17 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/includes/HsFFI.h b/includes/HsFFI.h index dceabab86f..652fbea22b 100644 --- a/includes/HsFFI.h +++ b/includes/HsFFI.h @@ -153,6 +153,10 @@ extern void hs_add_root (void (*init_root)(void)); extern void hs_perform_gc (void); +extern void hs_lock_stable_tables (void); +extern void hs_unlock_stable_tables (void); +extern void hs_free_stable_ptr_unsafe (HsStablePtr sp); + extern void hs_free_stable_ptr (HsStablePtr sp); extern void hs_free_fun_ptr (HsFunPtr fp); diff --git a/includes/rts/Stable.h b/includes/rts/Stable.h index ec867e486c..9f785eea01 100644 --- a/includes/rts/Stable.h +++ b/includes/rts/Stable.h @@ -21,19 +21,22 @@ StgStablePtr getStablePtr (StgPtr p); PRIVATE from here. -------------------------------------------------------------------------- */ -typedef struct { - StgPtr addr; /* Haskell object, free list, or NULL */ - StgPtr old; /* old Haskell object, used during GC */ - StgWord ref; /* used for reference counting */ - StgClosure *sn_obj; /* the StableName object (or NULL) */ +typedef struct { + StgPtr addr; /* Haskell object, free list, or NULL */ + StgPtr old; /* old Haskell object, used during GC */ + StgClosure *sn_obj; /* the StableName object (or NULL) */ } snEntry; -extern DLL_IMPORT_RTS snEntry *stable_ptr_table; +typedef struct { + StgPtr addr; +} spEntry; + +extern DLL_IMPORT_RTS snEntry *stable_name_table; +extern DLL_IMPORT_RTS spEntry *stable_ptr_table; EXTERN_INLINE StgPtr deRefStablePtr(StgStablePtr sp) { - ASSERT(stable_ptr_table[(StgWord)sp].ref > 0); return stable_ptr_table[(StgWord)sp].addr; } diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index eec98c2357..68c6212396 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -472,7 +472,7 @@ extern StgWord RTS_VAR(atomic_modify_mutvar_mutex); extern StgWord RTS_VAR(RtsFlags); // bogus type // Stable.c -extern StgWord RTS_VAR(stable_ptr_table); +extern StgWord RTS_VAR(stable_name_table); // Profiling.c extern unsigned int RTS_VAR(era); |