aboutsummaryrefslogtreecommitdiff
path: root/src/xrescheck.c
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-09-19 17:46:20 +1000
committerallusive-dev <[email protected]>2023-09-19 17:46:20 +1000
commit5650d887357bf2a3fac8c5fd4f467bf8795b5fc4 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/xrescheck.c
parentUpdate picom.sample.conf (diff)
downloadcompfy-5650d887357bf2a3fac8c5fd4f467bf8795b5fc4.tar.xz
compfy-5650d887357bf2a3fac8c5fd4f467bf8795b5fc4.zip
reset
Diffstat (limited to 'src/xrescheck.c')
-rw-r--r--src/xrescheck.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/xrescheck.c b/src/xrescheck.c
deleted file mode 100644
index 1785fc8..0000000
--- a/src/xrescheck.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// SPDX-License-Identifier: MIT
-// Copyright (c) 2014 Richard Grenville <[email protected]>
-
-#include "compiler.h"
-#include "log.h"
-
-#include "xrescheck.h"
-
-static xrc_xid_record_t *gs_xid_records = NULL;
-
-#define HASH_ADD_XID(head, xidfield, add) HASH_ADD(hh, head, xidfield, sizeof(xid), add)
-
-#define HASH_FIND_XID(head, findxid, out) HASH_FIND(hh, head, findxid, sizeof(xid), out)
-
-#define M_CPY_POS_DATA(prec) \
- prec->file = file; \
- prec->func = func; \
- prec->line = line;
-
-/**
- * @brief Add a record of given XID to the allocation table.
- */
-void xrc_add_xid_(XID xid, const char *type, M_POS_DATA_PARAMS) {
- auto prec = ccalloc(1, xrc_xid_record_t);
- prec->xid = xid;
- prec->type = type;
- M_CPY_POS_DATA(prec);
-
- HASH_ADD_XID(gs_xid_records, xid, prec);
-}
-
-/**
- * @brief Delete a record of given XID in the allocation table.
- */
-void xrc_delete_xid_(XID xid, M_POS_DATA_PARAMS) {
- xrc_xid_record_t *prec = NULL;
- HASH_FIND_XID(gs_xid_records, &xid, prec);
- if (!prec) {
- log_error("XRC: %s:%d %s(): Can't find XID %#010lx we want to delete.",
- file, line, func, xid);
- return;
- }
- HASH_DEL(gs_xid_records, prec);
- free(prec);
-}
-
-/**
- * @brief Report about issues found in the XID allocation table.
- */
-void xrc_report_xid(void) {
- for (xrc_xid_record_t *prec = gs_xid_records; prec; prec = prec->hh.next)
- log_trace("XRC: %s:%d %s(): %#010lx (%s) not freed.\n", prec->file,
- prec->line, prec->func, prec->xid, prec->type);
-}
-
-/**
- * @brief Clear the XID allocation table.
- */
-void xrc_clear_xid(void) {
- xrc_xid_record_t *prec = NULL, *ptmp = NULL;
- HASH_ITER(hh, gs_xid_records, prec, ptmp) {
- HASH_DEL(gs_xid_records, prec);
- free(prec);
- }
-}