blob: 6cce01258a8fd81e3a656df56d6ba1f2be7ac3d2 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#include "aos/common/queue_testutils.h"
2#include "aos/common/queue.h"
3
4namespace aos {
5namespace common {
6namespace testing {
7
8GlobalCoreInstance::GlobalCoreInstance() {
9 const size_t kCoreSize = 0x100000;
10 global_core = &global_core_data_;
11 global_core->owner = 1;
12 void *memory = malloc(kCoreSize);
13 assert(memory != NULL);
14 memset(memory, 0, kCoreSize);
15
16 assert(aos_core_use_address_as_shared_mem(memory, kCoreSize) == 0);
17}
18
19GlobalCoreInstance::~GlobalCoreInstance() {
20 free(global_core->mem_struct);
21 global_core = NULL;
22}
23
24} // namespace testing
25} // namespace common
26} // namespace aos