From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D74FD1F910 for ; Wed, 16 Nov 2022 09:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1668592004; bh=piIDBqV3cD529/JJ2lFeYV3gei2eF2ETZ9tDry6n5fs=; h=From:To:Subject:Date:From; b=XaSH6v2zqNbDqP6FBbI8m6pLb1+/Tu/C2qGQ1CS3lJfwzEC3npJ9rAfLTBsTMfdF4 Sm5xlRfHQubVwFfy9SkyhfgR5GlkD68SSvIe3VlC5LFoeVuHglECcMyseIhlcJuq0/ KajW76YAevpHKNjx/bt3OdINY1B91HkM1hrBtfUg= From: Eric Wong To: mwrap-perl@80x24.org Subject: [RFC] WIP custom C API Date: Wed, 16 Nov 2022 09:46:44 +0000 Message-Id: <20221116094644.3974467-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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;