No subject
Fri Feb 7 17:06:29 2003
Return-Path: xorp-cvs-admin@icir.org
Delivery-Date: Fri, 07 Feb 2003 17:07:10 -0800
Received: from wyvern.icir.org (wyvern.icir.org [192.150.187.14])
by tigger.icir.org (8.12.3/8.12.3) with ESMTP id h1817Aws020769
for <atanu@tigger.icir.org>; Fri, 7 Feb 2003 17:07:10 -0800 (PST)
(envelope-from xorp-cvs-admin@icir.org)
Received: from ICSI.Berkeley.EDU (fruitcake.ICSI.Berkeley.EDU [192.150.186.11])
by wyvern.icir.org (8.12.3/8.12.3) with ESMTP id h1817960096418
for <atanu@icir.org>; Fri, 7 Feb 2003 17:07:09 -0800 (PST)
(envelope-from xorp-cvs-admin@icir.org)
Received: from fruitcake.icsi.Berkeley.EDU (localhost [127.0.0.1])
by ICSI.Berkeley.EDU (8.9.0/8.9.0) with ESMTP id RAA14675;
Fri, 7 Feb 2003 17:07:01 -0800 (PST)
Received: from wyvern.icir.org (wyvern.icir.org [192.150.187.14])
by ICSI.Berkeley.EDU (8.9.0/8.9.0) with ESMTP id RAA14655
for <xorp-cvs@icsi.berkeley.edu>; Fri, 7 Feb 2003 17:06:30 -0800 (PST)
Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68])
by wyvern.icir.org (8.12.3/8.12.3) with ESMTP id h1816U60096412
for <xorp-cvs@icir.org>; Fri, 7 Feb 2003 17:06:30 -0800 (PST)
(envelope-from hodson@xorpc.icir.org)
Received: from xorpc.icir.org (localhost [127.0.0.1])
by xorpc.icir.org (8.12.3/8.12.3) with ESMTP id h1816T8a090591
for <xorp-cvs@icir.org>; Fri, 7 Feb 2003 17:06:29 -0800 (PST)
(envelope-from hodson@xorpc.icir.org)
Received: (from hodson@localhost)
by xorpc.icir.org (8.12.3/8.12.3/Submit) id h1816TAo090590;
Fri, 7 Feb 2003 17:06:29 -0800 (PST)
(envelope-from hodson)
From: Orion Hodson <hodson@icir.org>
Message-Id: <200302080106.h1816TAo090590@xorpc.icir.org>
Date: Fri, 7 Feb 2003 17:06:29 ()
To: xorp-cvs@icir.org
Reply-To: hodson@icir.org
Subject: [Xorp-cvs] XORP cvs commit: xorp/libxorp/ ref_ptr.hh ref_ptr.cc
Sender: xorp-cvs-admin@icir.org
Errors-To: xorp-cvs-admin@icir.org
X-BeenThere: xorp-cvs@icir.org
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:xorp-cvs-request@icir.org?subject=help>
List-Post: <mailto:xorp-cvs@icir.org>
List-Subscribe: <http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs>,
<mailto:xorp-cvs-request@icir.org?subject=subscribe>
List-Id: Mailing list for XORP CVS commit messages <xorp-cvs.icir.org>
List-Unsubscribe: <http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs>,
<mailto:xorp-cvs-request@icir.org?subject=unsubscribe>
CVSROOT: /usr/local/www/data/cvs
Module name: xorp
Repository: xorp/libxorp/
Changes by: hodson@xorpc.icir.org. 03/02/07 17:06:29
Modified files:
xorp/libxorp/: ref_ptr.hh ref_ptr.cc
Log message:
Add cref_ptr - compact reference pointer class. A slower, but more
compact reference pointer class with exactly the same interface as the
existing ref_ptr.
A cref_ptr is 4 bytes big. It represents an index into a table. Each
entry in the table contains a 4 byte counter and a void* pointer. The
entry is shared by however many cref_ptr's reference the underlying
data.
The penalty of cref_ptr is a function call and an indirection when
accessing the data. In contrast, ref_ptr has the pointer as part of
the structure and has no access penalty, but is larger at 4 bytes plus
the size of the pointer.
On a 32-bit box with n cref_ptr's to same data the size is 8 + 4n
bytes, whilst for a ref_ptr it's 4 + 8n bytes. We could squeeze the
cref_ptr size of cref_ptr down further, but the current implementation
will cause limit the number of available cref_ptr's accordingly (see
code to understand why).
_______________________________________________
Xorp-cvs mailing list
Xorp-cvs@icir.org
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs