Руслан Урядинский / libuavcan

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers coverity_scan_model.cpp Source File

coverity_scan_model.cpp

00001 /*
00002  * Coverity Scan model.
00003  *
00004  * - A model file can't import any header files.
00005  * - Therefore only some built-in primitives like int, char and void are
00006  *   available but not wchar_t, NULL etc.
00007  * - Modeling doesn't need full structs and typedefs. Rudimentary structs
00008  *   and similar types are sufficient.
00009  * - An uninitialized local pointer is not an error. It signifies that the
00010  *   variable could be either NULL or have some data.
00011  *
00012  * Coverity Scan doesn't pick up modifications automatically. The model file
00013  * must be uploaded by an admin in the analysis settings of
00014  * https://scan.coverity.com/projects/1513
00015  */
00016 
00017 namespace std
00018 {
00019     typedef unsigned long size_t;
00020 }
00021 
00022 namespace uavcan
00023 {
00024 
00025 void handleFatalError(const char* msg)
00026 {
00027     __coverity_panic__();
00028 }
00029 
00030 template <std::size_t PoolSize, std::size_t BlockSize>
00031 class PoolAllocator
00032 {
00033 public:
00034     void* allocate(std::size_t size)
00035     {
00036         return __coverity_alloc__(size);
00037     }
00038 
00039     void deallocate(const void* ptr)
00040     {
00041         __coverity_free__(ptr);
00042     }
00043 };
00044 
00045 }