mwrap (Perl version) user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: mwrap-perl@80x24.org
Subject: [PATCH 1/4] support quiet accessor
Date: Sun,  3 Oct 2021 07:41:21 +0000	[thread overview]
Message-ID: <20211003074124.12921-2-e@80x24.org> (raw)
In-Reply-To: <20211003074124.12921-1-e@80x24.org>

This lets developers elide overhead and tracking for
certain parts of their code.
---
 Mwrap.xs  | 7 +++++++
 t/mwrap.t | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/Mwrap.xs b/Mwrap.xs
index ca408b9..c93223e 100644
--- a/Mwrap.xs
+++ b/Mwrap.xs
@@ -781,6 +781,13 @@ BOOT:
 
 PROTOTYPES: ENABLE
 
+size_t
+mwrap_quiet(int on_off)
+CODE:
+	RETVAL = on_off ? locating++ : locating--;
+OUTPUT:
+	RETVAL
+
 size_t
 mwrap_current_age()
 CODE:
diff --git a/t/mwrap.t b/t/mwrap.t
index aba9709..fdae523 100644
--- a/t/mwrap.t
+++ b/t/mwrap.t
@@ -124,6 +124,9 @@ $age_after >= $age_before or die "age did not increment";
 EOF
 diag slurp($out);
 
+is(Devel::Mwrap::quiet(1), 0, 'was not quiet, before');
+is(Devel::Mwrap::quiet(0), 1, 'was quiet, before');
+
 done_testing();
 
 sub slurp {

  reply	other threads:[~2021-10-03  7:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03  7:41 [PATCH 0/4] PSGI support Eric Wong
2021-10-03  7:41 ` Eric Wong [this message]
2021-10-03  7:41 ` [PATCH 2/4] each: support passing user args to callback Eric Wong
2021-10-03  7:41 ` [PATCH 3/4] treewide: require Perl 5.12, doc+copyright updates Eric Wong
2021-10-03  7:41 ` [PATCH 4/4] add PSGI front-end Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211003074124.12921-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=mwrap-perl@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap-perl.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).