| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bin/eventhandler.h" | 5 #include "bin/eventhandler.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 #include <sys/epoll.h> | 11 #include <sys/epoll.h> |
| 12 #include <sys/stat.h> | 12 #include <sys/stat.h> |
| 13 #include <sys/time.h> | 13 #include <sys/time.h> |
| 14 #include <unistd.h> | 14 #include <unistd.h> |
| 15 | 15 |
| 16 #include "bin/dartutils.h" | 16 #include "bin/dartutils.h" |
| 17 #include "bin/fdutils.h" | 17 #include "bin/fdutils.h" |
| 18 #include "bin/hashmap.h" | 18 #include "platform/hashmap.h" |
| 19 #include "platform/thread.h" | 19 #include "platform/thread.h" |
| 20 #include "platform/utils.h" | 20 #include "platform/utils.h" |
| 21 | 21 |
| 22 | 22 |
| 23 int64_t GetCurrentTimeMilliseconds() { | 23 int64_t GetCurrentTimeMilliseconds() { |
| 24 struct timeval tv; | 24 struct timeval tv; |
| 25 if (gettimeofday(&tv, NULL) < 0) { | 25 if (gettimeofday(&tv, NULL) < 0) { |
| 26 UNREACHABLE(); | 26 UNREACHABLE(); |
| 27 return 0; | 27 return 0; |
| 28 } | 28 } |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { | 420 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { |
| 421 // The hashmap does not support keys with value 0. | 421 // The hashmap does not support keys with value 0. |
| 422 return reinterpret_cast<void*>(fd + 1); | 422 return reinterpret_cast<void*>(fd + 1); |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 426 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 427 // The hashmap does not support keys with value 0. | 427 // The hashmap does not support keys with value 0. |
| 428 return dart::Utils::WordHash(fd + 1); | 428 return dart::Utils::WordHash(fd + 1); |
| 429 } | 429 } |
| OLD | NEW |