-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreftrack.h
More file actions
22 lines (17 loc) · 885 Bytes
/
reftrack.h
File metadata and controls
22 lines (17 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: Apache-2.0
/************************************************************
Copyright (C) 2023-2025 Aravind Ceyardass (dev@aravind.cc)
************************************************************/
#ifndef REFTRACK__
#define REFTRACK__
#define REFTRACK_IGNORE_FLAG 0x1
#define REFTRACK_HEAP_FN_FLAG 0x2
#define REFTRACK_DESTRUCTOR_FN_FLAG 0x4
#define REFTRACK __attribute__((__reftrack__()))
#define REFTRACK_CUSTOM(S) __attribute__((__reftrack__(S##_addref, S##_removeref)))
#define REFTRACK_IGNORE __attribute__((__reftrack__(REFTRACK_IGNORE_FLAG)))
#define REFTRACK_HEAP_FN __attribute__((__reftrack__(REFTRACK_HEAP_FN_FLAG | REFTRACK_IGNORE_FLAG)))
#define REFTRACK_DESTRUCTOR_FN __attribute__((__reftrack__(REFTRACK_DESTRUCTOR_FN_FLAG)))
#define REFTRACK_NOP(x)
#define MALLOC_LIKE __attribute__((__malloc__))
#endif // REF TRACK__