diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-01 13:55:54 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-01 13:55:54 -0700 |
commit | fa275a97b968060383fe27c26b1d85f08d9582f9 (patch) | |
tree | c9cb183c78e6aa53f4d62aa80a7977c9e8f22191 /src/core/iomgr/fd_posix.c | |
parent | 0bdfe8b147b8101080e95565d9472e402f4d98d4 (diff) |
Label all iomgr objects
This allows a list of them to be dumped to isolate where memory leaks
are occuring.
Diffstat (limited to 'src/core/iomgr/fd_posix.c')
-rw-r--r-- | src/core/iomgr/fd_posix.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c index b697fcc64a..4ba06676ab 100644 --- a/src/core/iomgr/fd_posix.c +++ b/src/core/iomgr/fd_posix.c @@ -41,7 +41,6 @@ #include <sys/socket.h> #include <unistd.h> -#include "src/core/iomgr/iomgr_internal.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/useful.h> @@ -119,7 +118,7 @@ static void unref_by(grpc_fd *fd, int n) { close(fd->fd); grpc_iomgr_add_callback(fd->on_done, fd->on_done_user_data); freelist_fd(fd); - grpc_iomgr_unref(); + grpc_iomgr_unregister_object(&fd->iomgr_object); } else { GPR_ASSERT(old > n); } @@ -138,9 +137,9 @@ void grpc_fd_global_shutdown(void) { static void do_nothing(void *ignored, int success) {} -grpc_fd *grpc_fd_create(int fd) { +grpc_fd *grpc_fd_create(int fd, const char *name) { grpc_fd *r = alloc_fd(fd); - grpc_iomgr_ref(); + grpc_iomgr_register_object(&r->iomgr_object, name); grpc_pollset_add_fd(grpc_backup_pollset(), r); return r; } |