Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55988 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95905 invoked from network); 29 Oct 2011 11:44:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2011 11:44:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:37338] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/A1-17222-F17EBAE4 for ; Sat, 29 Oct 2011 07:44:31 -0400 Received: by wyf23 with SMTP id 23so5107636wyf.29 for ; Sat, 29 Oct 2011 04:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; bh=wM9gg4OT/wqIPL9bCq2v6S27o/6TiyQWtqnc2cs4ySU=; b=HKUw0U+X6aB+2pFhZ4OMI+oG2Y36DABJwiE2pbUdRKZvs3rGq5GmAQXeyZUpBYiKln iWYp24u+87pVMCmckU7eU1b2M07S/4ewJayrx8E+hLIsSWHdIKXWS++2sD4fY5emDQVZ oqRHe941Va2aTw7DK3w3fCieUUkgZnGmKn5GM= Received: by 10.227.202.71 with SMTP id fd7mr8512569wbb.9.1319888667765; Sat, 29 Oct 2011 04:44:27 -0700 (PDT) Received: from noch2.localnet (130-244-168-88.selfip.net. [88.168.244.130]) by mx.google.com with ESMTPS id fy21sm3379842wbb.5.2011.10.29.04.44.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Oct 2011 04:44:26 -0700 (PDT) To: internals@lists.php.net Date: Sat, 29 Oct 2011 13:44:27 +0200 User-Agent: KMail/1.13.7 (Linux/3.0.0-1-amd64; KDE/4.6.5; x86_64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <201110291344.27199.arnaud.lb@gmail.com> Subject: [PATCH] Bug #60139 closure memory leaks From: arnaud.lb@gmail.com (Arnaud Le Blanc) Hi, Closures can hold references to variables, but don't expose them to the garbage collector. The GC is unable to find cycles in which a closure is involved, and this can create memory leaks. I've reported this problem in https://bugs.php.net/bug.php?id=60139 and posted a patch. Can someone please review it ? This fixes the problem by returning the closure's closed variables and this_ptr from get_properties (most of this has been copied from SplObjectStorage's get_properties). I would like to commit in 5.3 as well. Best Regards,