+ if (size > UINT32_MAX - DATA_QUEUE_MEMORY_HEADER_SIZE) {
+ return false;
+ }
+
+ allocSize = round_page(size + DATA_QUEUE_MEMORY_HEADER_SIZE);
+
+ if (allocSize < size) {
+ return false;
+ }
+
+ assert(!notifyMsg);
+ notifyMsg = IONew(IODataQueueInternal, 1);
+ if (!notifyMsg) {
+ return false;
+ }
+ bzero(notifyMsg, sizeof(IODataQueueInternal));
+ ((IODataQueueInternal *)notifyMsg)->queueSize = size;
+
+ dataQueue = (IODataQueueMemory *)IOMallocAligned(allocSize, PAGE_SIZE);