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

Side by Side Diff: runtime/bin/socket.h

Issue 2533303005: VM: Fix memory leak during shutdown (Closed)
Patch Set: Simplify socket.cc by not updating hashmaps during shutdown Created 4 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
« no previous file with comments | « runtime/bin/hashmap_test.cc ('k') | runtime/bin/socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #ifndef RUNTIME_BIN_SOCKET_H_ 5 #ifndef RUNTIME_BIN_SOCKET_H_
6 #define RUNTIME_BIN_SOCKET_H_ 6 #define RUNTIME_BIN_SOCKET_H_
7 7
8 #if defined(DART_IO_DISABLED) 8 #if defined(DART_IO_DISABLED)
9 #error "socket.h can only be included on builds with IO enabled" 9 #error "socket.h can only be included on builds with IO enabled"
10 #endif 10 #endif
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 462 }
463 463
464 OSSocket* LookupByPort(intptr_t port); 464 OSSocket* LookupByPort(intptr_t port);
465 void InsertByPort(intptr_t port, OSSocket* socket); 465 void InsertByPort(intptr_t port, OSSocket* socket);
466 void RemoveByPort(intptr_t port); 466 void RemoveByPort(intptr_t port);
467 467
468 OSSocket* LookupByFd(intptr_t fd); 468 OSSocket* LookupByFd(intptr_t fd);
469 void InsertByFd(intptr_t fd, OSSocket* socket); 469 void InsertByFd(intptr_t fd, OSSocket* socket);
470 void RemoveByFd(intptr_t fd); 470 void RemoveByFd(intptr_t fd);
471 471
472 bool CloseOneSafe(OSSocket* os_socket); 472 bool CloseOneSafe(OSSocket* os_socket, bool update_hash_maps);
473 void CloseAllSafe(); 473 void CloseAllSafe();
474 474
475 HashMap sockets_by_port_; 475 HashMap sockets_by_port_;
476 HashMap sockets_by_fd_; 476 HashMap sockets_by_fd_;
477 477
478 Mutex* mutex_; 478 Mutex* mutex_;
479 479
480 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry); 480 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry);
481 }; 481 };
482 482
483 } // namespace bin 483 } // namespace bin
484 } // namespace dart 484 } // namespace dart
485 485
486 #endif // RUNTIME_BIN_SOCKET_H_ 486 #endif // RUNTIME_BIN_SOCKET_H_
OLDNEW
« no previous file with comments | « runtime/bin/hashmap_test.cc ('k') | runtime/bin/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698