diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-03-13 19:42:47 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-17 05:05:10 -0400 |
commit | cb61371e3260e07be724a04b72a935133f66b514 (patch) | |
tree | 456e4f3fa84ab7f8fa94ed66f717f6ea949899f8 /rts/PrimOps.cmm | |
parent | 3f2291e47b8e00f1312c9be31484ceddd1289212 (diff) | |
download | haskell-cb61371e3260e07be724a04b72a935133f66b514.tar.gz |
ghc-heap: Introduce closureSize
This function allows the user to compute the (non-transitive) size of a
heap object in words. The "closure" in the name is admittedly confusing
but we are stuck with this nomenclature at this point.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 625f5f5ab3..bc89839aec 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -2041,6 +2041,13 @@ for: return (info, dat_arr, ptrArray); } +stg_closureSizzezh (P_ clos) +{ + W_ len; + (len) = foreign "C" heap_view_closureSize(UNTAG(clos) "ptr"); + return (len); +} + /* ----------------------------------------------------------------------------- Thread I/O blocking primitives -------------------------------------------------------------------------- */ |