Code analysis violations Bug in scheduler - race during with worker thread shutdown.
Showing the changes to src/include (2 of 18 files). Show all
Unified · Split
| @@ -60,6 +60,42 @@ namespace disvm · 59 unmodified lines | ||
| 60 | 60 | static_assert( |
| 61 | 61 | sizeof(vm_frame_base_alloc_t) == runtime_constants::default_register_count * runtime_constants::default_register_size_bytes, |
| 62 | 62 | "Default register allocation should match base allocation type"); |
| 63 | + | |
| 64 | + // | |
| 65 | + // Helpers for accessing VM types | |
| 66 | + // | |
| 67 | + | |
| 68 | + // Get value-type reference | |
| 69 | + template<typename ValueType> | |
| 70 | + ValueType& vt_ref(pointer_t vt) | |
| 71 | + { | |
| 72 | + assert(vt != nullptr); | |
| 73 | + return *reinterpret_cast<ValueType *>(vt); | |
| 74 | + } | |
| 75 | + | |
| 76 | + // Get allocation type value | |
| 77 | + template<typename AllocType> | |
| 78 | + typename std::enable_if<std::is_base_of<vm_alloc_t, AllocType>::value, AllocType *>::type | |
| 79 | + at_val(pointer_t at) | |
| 80 | + { | |
| 81 | + assert(at != nullptr); | |
| 82 | + return vm_alloc_t::from_allocation<AllocType>(*reinterpret_cast<pointer_t *>(at)); | |
| 83 | + } | |
| 84 | + | |
| 85 | + // Get allocation type value - base alloc type | |
| 86 | + template<> | |
| 87 | + inline vm_alloc_t *at_val<vm_alloc_t>(pointer_t at) | |
| 88 | + { | |
| 89 | + assert(at != nullptr); | |
| 90 | + return vm_alloc_t::from_allocation(*reinterpret_cast<pointer_t *>(at)); | |
| 91 | + } | |
| 92 | + | |
| 93 | + // Get pointer type reference | |
| 94 | + inline pointer_t &pt_ref(pointer_t pt) | |
| 95 | + { | |
| 96 | + assert(pt != nullptr); | |
| 97 | + return *reinterpret_cast<pointer_t *>(pt); | |
| 98 | + } | |
| 63 | 99 | } |
| 64 | 100 | } |
| 65 | 101 | |
| @@ -249,7 +249,7 @@ namespace disvm · 248 unmodified lines | ||
| 249 | 249 | |
| 250 | 250 | vm_list_t* get_tail() const; |
| 251 | 251 | |
| 252 | − vm_list_t* drop_tail(); | |
| 252 | + void set_tail(vm_list_t *new_tail); | |
| 253 | 253 | |
| 254 | 254 | // Returns a pointer to the value |
| 255 | 255 | pointer_t value() const; |