Return-Path: Delivered-To: apmail-lucene-lucy-dev-archive@minotaur.apache.org Received: (qmail 13793 invoked from network); 26 Nov 2009 09:18:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Nov 2009 09:18:17 -0000 Received: (qmail 42552 invoked by uid 500); 26 Nov 2009 09:18:17 -0000 Delivered-To: apmail-lucene-lucy-dev-archive@lucene.apache.org Received: (qmail 42489 invoked by uid 500); 26 Nov 2009 09:18:17 -0000 Mailing-List: contact lucy-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@lucene.apache.org Delivered-To: mailing list lucy-dev@lucene.apache.org Received: (qmail 42479 invoked by uid 99); 26 Nov 2009 09:18:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 09:18:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.85.222.176] (HELO mail-pz0-f176.google.com) (209.85.222.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 09:18:05 +0000 Received: by pzk6 with SMTP id 6so408556pzk.29 for ; Thu, 26 Nov 2009 01:17:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.25.38 with SMTP id c38mr989953wfj.253.1259227063686; Thu, 26 Nov 2009 01:17:43 -0800 (PST) Date: Thu, 26 Nov 2009 01:17:43 -0800 Message-ID: <65d3176c0911260117m3ec0f8f0nfc4690a2ea4e0af0@mail.gmail.com> Subject: Hierarchical memory allocation in C From: Nathan Kurz To: lucy-dev@lucene.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org I was recently researching memory allocators and came across talloc: http://samba.org/ftp/unpacked/talloc/talloc_guide.txt Talloc has a cool interface: "talloc is a hierarchical, reference counted memory pool system with destructors." It's main uniqueness is that every allocation address returned can also be used as a context for future allocations, so that all the components of an object can very simply be allocated as belonging to that object. Good short explanation here: http://foss.in/2007/register/slides/talloc__The_Power_of_C_509.pdf I've never actually used it, but it's probably worth 15 minutes of exploration to determine if this might be an interface worth swiping for Lucy at some point. Nathan Kurz nate@verse.com