[PATCH] D59551: [scudo][standalone] Add error reports

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 11:04:32 PDT 2019


cryptoad marked 2 inline comments as done.
cryptoad added inline comments.


================
Comment at: lib/scudo/standalone/report.h:36
+void NORETURN reportOutOfMemory(uptr RequestedSize);
+enum : u8 {
+  Recycling,
----------------
hctim wrote:
> Is there a reason why the use of this enum is deliberately occluded from those who use it? Why don't you use this as an `enum class AllocatorAction` with an internal `toString` method, and then `reportInvalidChunkState(..)` and others can take `AllocatorAction Action` as the first argument, instead of occluding it into a u8?
> 
> This would also remove the need to have `ActionsCount` and check-fail on this (`report.cc:115`), as you would have compile-time guarantees that the provided enum value is in range.
I think the only reasoning I had was to try and keep things compact, uploading a version that hopefully fits the requirements.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59551/new/

https://reviews.llvm.org/D59551





More information about the llvm-commits mailing list