This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Adding vector, bytemap & stats
AbandonedPublic

Authored by cryptoad on Feb 26 2019, 10:12 AM.

Details

Summary

This CL adds a few more classes and some tests:

  • bytemap: to be used by the primary when it lands;
  • stats: to be used by the primary & secondary;
  • vector: to be used by scoped strings when they land.

Code is clang-format with llvm style.

Event Timeline

cryptoad created this revision.Feb 26 2019, 10:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 26 2019, 10:12 AM
Herald added subscribers: llvm-commits, Restricted Project, jfb and 2 others. · View Herald Transcript
vitalybuka added inline comments.Feb 26 2019, 10:30 AM
lib/scudo/standalone/CMakeLists.txt
44

This patch should be 3 patches.

lib/scudo/standalone/bytemap.h
58

I assume this is mostly fork from sanitizer_common.
I do not insists, but it would be nice to do that it two steps:

  1. Patch with unmodified copy (maybe single large patch for all files used in standalone version) so that fabricator shows this as a copy
  2. Patch with changes
lib/scudo/standalone/vector.h
20

have you considered to use std::vector with custom allocator?

cryptoad abandoned this revision.Feb 26 2019, 10:39 AM
cryptoad marked 3 inline comments as done.

Redoing as 3 separate patches as per Vitaly's request. With some replies to comments.

lib/scudo/standalone/CMakeLists.txt
44

I will redo that in 3 patches.

lib/scudo/standalone/bytemap.h
58

So this is tricky.
There are enough form changes to have a diff be significantly unreadable:

  • g3 code style becomes llvm code style (changing casing, function names, variable names)
  • g3 clang-format becomes llvm code format (spacing, line cuts)

Added on top of that are content changes (not as many platforms supported, less backward compat "hacks").

lib/scudo/standalone/vector.h
20

We are compiling with -nostdinc++ and no standard c++ library as well (to be included in a libc).
So we are reimplementing basic c++ classes like that.