[flang-commits] [flang] [flang][runtime] Interoperable POINTER deallocation validation (PR #96100)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Mon Jun 24 08:31:07 PDT 2024
================
@@ -124,6 +124,23 @@ void RTDEF(PointerAssociateRemapping)(Descriptor &pointer,
}
}
+RT_API_ATTRS void *AllocateValidatedPointerPayload(std::size_t byteSize) {
+ // Add space for a footer to validate during deallocation.
+ constexpr std::size_t align{sizeof(std::uintptr_t)};
+ byteSize = ((byteSize / align) + 1) * align;
----------------
klausler wrote:
If `byteSize` is initially zero, I want the result to be `align`, not zero.
https://github.com/llvm/llvm-project/pull/96100
More information about the flang-commits
mailing list