1 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "mojo/edk/system/ports/event.h" 6 7 #include <string.h> 8 9 namespace mojo { 10 namespace edk { 11 namespace ports { 12 13 namespace { 14 15 const size_t kPortsMessageAlignment = 8; 16 17 static_assert(sizeof(PortDescriptor) % kPortsMessageAlignment == 0, 18 "Invalid PortDescriptor size."); 19 20 static_assert(sizeof(EventHeader) % kPortsMessageAlignment == 0, 21 "Invalid EventHeader size."); 22 23 static_assert(sizeof(UserEventData) % kPortsMessageAlignment == 0, 24 "Invalid UserEventData size."); 25 26 static_assert(sizeof(ObserveProxyEventData) % kPortsMessageAlignment == 0, 27 "Invalid ObserveProxyEventData size."); 28 29 static_assert(sizeof(ObserveProxyAckEventData) % kPortsMessageAlignment == 0, 30 "Invalid ObserveProxyAckEventData size."); 31 32 static_assert(sizeof(ObserveClosureEventData) % kPortsMessageAlignment == 0, 33 "Invalid ObserveClosureEventData size."); 34 35 static_assert(sizeof(MergePortEventData) % kPortsMessageAlignment == 0, 36 "Invalid MergePortEventData size."); 37 38 } // namespace 39 PortDescriptor()40PortDescriptor::PortDescriptor() { 41 memset(padding, 0, sizeof(padding)); 42 } 43 44 } // namespace ports 45 } // namespace edk 46 } // namespace mojo 47