* [RFC] WIP custom C API
@ 2022-11-16 9:46 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-11-16 9:46 UTC (permalink / raw)
To: mwrap-perl
I don't think this should be a serious patch, should it?
---
mwrap_core.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mwrap_core.h b/mwrap_core.h
index 3abc3dd..e37a9bb 100644
--- a/mwrap_core.h
+++ b/mwrap_core.h
@@ -604,6 +604,16 @@ void *realloc(void *ptr, size_t size)
return p;
}
+size_t mwrap_total_bytes_allocated(void)
+{
+ return uatomic_read(&total_bytes_inc);
+}
+
+size_t mwrap_total_bytes_freed(void)
+{
+ return uatomic_read(&total_bytes_dec);
+}
+
struct dump_arg {
FILE *fp;
size_t min;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-16 9:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 9:46 [RFC] WIP custom C API Eric Wong
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).