about summary refs log tree commit homepage
path: root/Mwrap.xs
diff options
context:
space:
mode:
Diffstat (limited to 'Mwrap.xs')
-rw-r--r--Mwrap.xs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Mwrap.xs b/Mwrap.xs
index 568ec2b..846d89d 100644
--- a/Mwrap.xs
+++ b/Mwrap.xs
@@ -132,6 +132,22 @@ mwrap_reset()
 CODE:
         mwrap_reset();
 
+unsigned
+mwrap_bt_depth(arg = &PL_sv_undef)
+        SV *arg;
+CODE:
+        if (SvOK(arg)) {
+                UV n = SvUVx(arg);
+                if (n > MWRAP_BT_MAX)
+                        n = MWRAP_BT_MAX;
+                CMM_STORE_SHARED(bt_req_depth, (uint32_t)n);
+                RETVAL = n;
+        } else {
+                RETVAL = CMM_LOAD_SHARED(bt_req_depth);
+        }
+OUTPUT:
+        RETVAL
+
 Devel::Mwrap::SrcLoc
 mwrap_get(loc)
         SV *loc;