brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #include "aos/common/queue_testutils.h" |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame] | 2 | |
| 3 | #include <string.h> |
| 4 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 5 | #include "aos/common/queue.h" |
| 6 | |
| 7 | namespace aos { |
| 8 | namespace common { |
| 9 | namespace testing { |
| 10 | |
| 11 | GlobalCoreInstance::GlobalCoreInstance() { |
| 12 | const size_t kCoreSize = 0x100000; |
| 13 | global_core = &global_core_data_; |
| 14 | global_core->owner = 1; |
| 15 | void *memory = malloc(kCoreSize); |
| 16 | assert(memory != NULL); |
| 17 | memset(memory, 0, kCoreSize); |
| 18 | |
| 19 | assert(aos_core_use_address_as_shared_mem(memory, kCoreSize) == 0); |
| 20 | } |
| 21 | |
| 22 | GlobalCoreInstance::~GlobalCoreInstance() { |
| 23 | free(global_core->mem_struct); |
| 24 | global_core = NULL; |
| 25 | } |
| 26 | |
| 27 | } // namespace testing |
| 28 | } // namespace common |
| 29 | } // namespace aos |