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

Unified Diff: runtime/bin/socket.h

Issue 2533303005: VM: Fix memory leak during shutdown (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/socket.h
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index 35d4acc870fa911e906958468097a506a7a5c2b6..d8f9e0126e40927a9819c8f736c0ad83ddb8d939 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -467,9 +467,12 @@ class ListeningSocketRegistry {
OSSocket* LookupByFd(intptr_t fd);
void InsertByFd(intptr_t fd, OSSocket* socket);
- void RemoveByFd(intptr_t fd);
- bool CloseOneSafe(OSSocket* os_socket);
+ // If `map_cursor` is provided it will be updated to point to the next
+ // element (in iteration order of `sockets_by_fd`) after `fd` was removed.
+ void RemoveByFd(intptr_t fd, HashMap::Entry** map_cursor);
+
+ bool CloseOneSafe(OSSocket* os_socket, HashMap::Entry** fd_map_cursor);
void CloseAllSafe();
HashMap sockets_by_port_;
« no previous file with comments | « runtime/bin/hashmap_test.cc ('k') | runtime/bin/socket.cc » ('j') | runtime/bin/socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698