blob: d35dc452e1389ada06a9885acce7fd94bb2f1e95 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#include "aos/common/queue_testutils.h"
Brian Silvermanf665d692013-02-17 22:11:39 -08002
3#include <string.h>
4
brians343bc112013-02-10 01:53:46 +00005#include "aos/common/queue.h"
6
7namespace aos {
8namespace common {
9namespace testing {
10
11GlobalCoreInstance::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
22GlobalCoreInstance::~GlobalCoreInstance() {
23 free(global_core->mem_struct);
24 global_core = NULL;
25}
26
27} // namespace testing
28} // namespace common
29} // namespace aos