Skip to content

Files

Latest commit

5df3559 · Apr 18, 2019

History

History
48 lines (31 loc) · 1.97 KB

USEME.md

File metadata and controls

48 lines (31 loc) · 1.97 KB

To compile and run an application using memory-safe-cpp:

  1. Check out memory-safe-cpp project recursively (yes, it refers to a few other modules)

  2. Compiler/platform/language:

  • Linux: GCC and CLANG (latest versions)
  • Windows: MSVC (latest version)

Currently only 64-bit platforms are supported. C++17 is required.

  1. Add paths to the following libraries:
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/include;
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/3rdparty/fmt/include;
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src;
  • [MEMORY-SAFE-CPP]/library/src; (for GCC and CLANG add respective -I compiler option; for MSVC: update VC++ directories -> include directories)
  1. Add the following source files:
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/3rdparty/fmt/src/format.cc
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/src/std_error.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/src/safe_memory_error.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/src/log.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/src/tagged_ptr_impl.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/foundation/src/cpu_exceptions_translator.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/safe_ptr.cpp

Also, on Linux:

  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/page_allocator_linux.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/iibmalloc_linux.cpp

Respectively, on Windows,

  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/page_allocator_windows.cpp
  • [MEMORY-SAFE-CPP]/library/src/iibmalloc/src/iibmalloc_windows.cpp
  1. Add the following #include directives to code:
  • #include <safe_ptr.h>
  1. Build with a compiler (in case of compiler errors like missing include files or unresolved calls, etc check above steps first, especially step 0)

  2. Proceed to safety checks with Code Checker (see [MEMORY-SAFE-CPP]/checker/doc/CHECKER-QUICK-START.md for details