From 568a84ed2d3d41da5ca64cde15a677237fffd991 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 21 Jan 2017 17:40:04 -0800 Subject: Fix leaks in bus, socket leaks, tighten up close-side refcnting. This does a few things. First it closes some preexisting leaks. Second it tightens the overall close logic so that we automatically discard idhash resources (while keeping numeric values for next id etc. around) when the last socket is closed. This then eliminates the need for applications to ever explicitly terminate resources. It turns out platform-specific resources established at nni_init() time might still be leaked, but it's also the case that we now no longer dynamically allocate anything at platform initialization time. (This presumes that the platform doesn't do so under the hood when creating critical sections or mutexes for example.) --- perf/perf.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'perf/perf.c') diff --git a/perf/perf.c b/perf/perf.c index 40b9c1f3..419d729f 100644 --- a/perf/perf.c +++ b/perf/perf.c @@ -20,17 +20,6 @@ // API, so don't be lazy like this! All nni_ symbols are subject to // change without notice, and not part of the stable API or ABI. #include "core/nng_impl.h" -#include "core/thread.c" -#include "core/clock.c" -#include "platform/posix/posix_impl.h" -#include "platform/posix/posix_alloc.c" -#include "platform/posix/posix_clock.c" -#include "platform/posix/posix_debug.c" -#include "platform/posix/posix_thread.c" -#include "platform/windows/win_impl.h" -#include "platform/windows/win_clock.c" -#include "platform/windows/win_debug.c" -#include "platform/windows/win_thread.c" static void latency_client(const char *, int, int); static void latency_server(const char *, int, int); @@ -107,12 +96,6 @@ nop(void) return (0); } -int -nni_init(void) -{ - return (nni_plat_init(nop)); -} - static void die(const char *fmt, ...) { -- cgit v1.2.3-70-g09d2