Lines Matching defs:memory
20 // Each thread will open the shared memory. Each thread will take a different 4
22 // Verify that each thread's value in the shared memory is always correct.
29 SharedMemory memory;
30 memory.Delete(s_test_name_);
37 SharedMemory memory;
38 bool rv = memory.Create(s_test_name_, false, true, kDataSize);
40 rv = memory.Map(kDataSize);
42 int *ptr = static_cast<int*>(memory.memory()) + id_;
51 memory.Close();
69 // Each thread will open the shared memory. Each thread will take the memory,
71 // between. Verify that each thread's value in the shared memory is always
94 volatile int* const ptr = static_cast<int*>(memory2.memory());
121 // Open two handles to a memory segment, confirm that they are mapped
139 EXPECT_NE(memory1.memory(), memory2.memory()); // Compare the pointers.
142 ASSERT_NE(memory1.memory(), static_cast<void*>(NULL));
143 ASSERT_NE(memory2.memory(), static_cast<void*>(NULL));
145 // Write data to the first memory segment, verify contents of second.
146 memset(memory1.memory(), '1', kDataSize);
147 EXPECT_EQ(memcmp(memory1.memory(), memory2.memory(), kDataSize), 0);
149 // Close the first memory segment, and verify the second has the right data.
151 char *start_ptr = static_cast<char *>(memory2.memory());
156 // Close the second memory segment.
165 // Create a set of N threads to each open a shared memory segment and write to
207 // Create a set of threads to each open a shared memory segment and write to it
230 // Allocate private (unique) shared memory with an empty string for a
249 int *ptr = static_cast<int*>(memories[i].memory());
284 SharedMemory memory;
285 memory.Delete(s_test_name_);
292 SharedMemory memory;
293 bool rv = memory.Create(s_test_name_, false, true, kDataSize);
297 rv = memory.Map(kDataSize);
301 int *ptr = static_cast<int*>(memory.memory());
304 memory.Lock();
310 memory.Unlock();
313 memory.Close();