X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oxJBKNjSsvc9jYjEp6BDjMCaLreZZfJ8tY7fXlqlpOg=; b=SGL4WeiZBy+A0/mNRNcE/QNK+D/zyj/uDVseVgF1bo+tTcOQZuvCJQlFu+O4ZjTqPk 6mMfcWykObt4wge68ExKutT5RH1YlMvlKxvF6YKc59a1ULL9peRyING11kanShDfIyAl fpFy9RaFr/YKx1k4wwdppCMDOOaESOmKlVcrqfkgYyxY84mJMzQHNiv/kRyL1IYA5Nrk cAp4tHpd8ERT0CKFI4aCwy5KhbEhDsNXOAA/FwrgGB1VNBmY7TGYzMADFWAbHx7diIXH Qqylw60lQOXEwYrCJcOJi0tZ658vmjHCgPEcgvO5F9pLLzU0KDhPPUdjkCbXP9o+tML+ yI2g== MIME-Version: 1.0 X-Received: by 10.50.107.104 with SMTP id hb8mr3887160igb.1.1443201692141; Fri, 25 Sep 2015 10:21:32 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Sep 2015 20:21:32 +0300 Message-ID: Subject: Re: dlclose not removing dependency dxes From: "Ozkan Sezer (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com]" To: djgpp Content-Type: text/plain; charset=UTF-8 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 9/25/15, Ozkan Sezer wrote: > AFAICS, dlclose()ing of a dxe doesn't remove its dependency dxes along > with it, which will result in unnecessarily occupied memory which may > prove fatal upon multiple dlopen()/dlclose() of a dxe with deps. This > needs addressing. > My last argument was inaccurate and misleading. Here's better: One has a.dxe and b.dxe; a.dxe depends on b.dxe. Do dlopen a.dxe and b.dxe is opened implicitly. Do dlcose a.dxe, and b.dxe stays open still occupying its memory. The memory occupied by the unused b.dxe might be needed by the app but will be unavailable to it. Further dlopen calls for a.dxe will increment the refcount for b.dxe which never gets decremented.