BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
static_variant.cpp
Go to the documentation of this file.
1 #include <fc/static_variant.hpp>
2 
3 
4 namespace fc { namespace impl {
5 
6 dynamic_storage::dynamic_storage() : storage(nullptr) {};
7 
9 {
10  release();
11 }
12 
13 void* dynamic_storage::data() const
14 {
15  FC_ASSERT( storage != nullptr );
16  return (void*)storage;
17 }
18 
19 void dynamic_storage::alloc( size_t size )
20 {
21  release();
22  storage = new char[size];
23 }
24 
26 {
27  delete [] storage;
28  storage = nullptr;
29 }
30 
31 }}
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
Definition: api.hpp:15