[flang-commits] [flang] [flang][runtime] Interoperable POINTER deallocation validation (PR #96100)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Sun Jun 23 21:20:00 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;
----------------
vzakhari wrote:
```suggestion
byteSize = ((byteSize + align - 1) / align) * align;
```
https://github.com/llvm/llvm-project/pull/96100
More information about the flang-commits
mailing list