This repository was archived by the owner on Mar 4, 2024. It is now read-only.
Commit e1e6fc7 Mathieu Borderé
authored
File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1079,6 +1079,19 @@ RAFT_API void raft_heap_set(struct raft_heap *heap);
1079
1079
*/
1080
1080
RAFT_API void raft_heap_set_default (void );
1081
1081
1082
+ /**
1083
+ * Return a reference to the current dynamic memory allocator.
1084
+ *
1085
+ * This is intended for use by applications that want to temporarily replace
1086
+ * and then restore the original allocator, or that want to defer to the
1087
+ * original allocator in some circumstances.
1088
+ *
1089
+ * The behavior of attempting to mutate the default allocator through the
1090
+ * pointer returned by this function, including attempting to deallocate
1091
+ * the backing memory, is undefined.
1092
+ */
1093
+ RAFT_API const struct raft_heap * raft_heap_get (void );
1094
+
1082
1095
#undef RAFT__REQUEST
1083
1096
1084
1097
#endif /* RAFT_H */
Original file line number Diff line number Diff line change @@ -114,3 +114,8 @@ void raft_heap_set_default(void)
114
114
{
115
115
currentHeap = & defaultHeap ;
116
116
}
117
+
118
+ const struct raft_heap * raft_heap_get (void )
119
+ {
120
+ return currentHeap ;
121
+ }
You can’t perform that action at this time.
0 commit comments