Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Side by Side Diff: runtime/bin/eventhandler_macos.cc

Issue 8659032: Fix memory leak in MacOS process handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | runtime/bin/process_linux.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 <errno.h> 5 #include <errno.h>
6 #include <poll.h> 6 #include <poll.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/time.h> 10 #include <sys/time.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 #ifdef DEBUG_POLL 195 #ifdef DEBUG_POLL
196 static void PrintEventMask(struct pollfd* pollfd) { 196 static void PrintEventMask(struct pollfd* pollfd) {
197 printf("%d ", pollfd->fd); 197 printf("%d ", pollfd->fd);
198 if ((pollfd->revents & POLLIN) != 0) printf("POLLIN "); 198 if ((pollfd->revents & POLLIN) != 0) printf("POLLIN ");
199 if ((pollfd->revents & POLLPRI) != 0) printf("POLLPRI "); 199 if ((pollfd->revents & POLLPRI) != 0) printf("POLLPRI ");
200 if ((pollfd->revents & POLLOUT) != 0) printf("POLLOUT "); 200 if ((pollfd->revents & POLLOUT) != 0) printf("POLLOUT ");
201 if ((pollfd->revents & POLLERR) != 0) printf("POLLERR "); 201 if ((pollfd->revents & POLLERR) != 0) printf("POLLERR ");
202 if ((pollfd->revents & POLLHUP) != 0) printf("POLLHUP "); 202 if ((pollfd->revents & POLLHUP) != 0) printf("POLLHUP ");
203 if ((pollfd->revents & POLLRDHUP) != 0) printf("POLLRDHUP ");
204 if ((pollfd->revents & POLLNVAL) != 0) printf("POLLNVAL "); 203 if ((pollfd->revents & POLLNVAL) != 0) printf("POLLNVAL ");
205 int all_events = POLLIN | POLLPRI | POLLOUT | 204 int all_events = POLLIN | POLLPRI | POLLOUT | POLLERR | POLLHUP | POLLNVAL;
206 POLLERR | POLLHUP | POLLRDHUP | POLLNVAL;
207 if ((pollfd->revents & ~all_events) != 0) { 205 if ((pollfd->revents & ~all_events) != 0) {
208 printf("(and %08x) ", pollfd->revents & ~all_events); 206 printf("(and %08x) ", pollfd->revents & ~all_events);
209 } 207 }
210 printf("(available %d) ", FDUtils::AvailableBytes(pollfd->fd)); 208 printf("(available %d) ", FDUtils::AvailableBytes(pollfd->fd));
211 209
212 printf("\n"); 210 printf("\n");
213 } 211 }
214 #endif 212 #endif
215 213
216 intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) { 214 intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 FATAL("Create start event handler thread"); 367 FATAL("Create start event handler thread");
370 } 368 }
371 } 369 }
372 370
373 371
374 void EventHandlerImplementation::SendData(intptr_t id, 372 void EventHandlerImplementation::SendData(intptr_t id,
375 Dart_Port dart_port, 373 Dart_Port dart_port,
376 intptr_t data) { 374 intptr_t data) {
377 WakeupHandler(id, dart_port, data); 375 WakeupHandler(id, dart_port, data);
378 } 376 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | runtime/bin/process_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698