logo       

Re: Re: Array interface: msg#00123

Subject: Re: Re: Array interface
Yamagata Yoriyuki wrote:

From: Alan Post <apost@xxxxxxxxxxxxxxxx>
Subject: [Ocaml-lib-devel] Re: Array interface
Date: Fri, 20 Jun 2003 23:56:25 +0000 (UTC)


What is under discussion is what to put in the "empty" slots of the
newly doubled array, ocaml having no "null" or "undef" value to stuff
in them.


I do not understand the motive of Dynarray,


Variable length array with automatic efficient resizing.
It needs to allocate more store than the number of
slots actually needed to minimise reallocation
on extension of the array, and allow contraction
without necessarily reallocating.

So there are some slots of the underlying array
that are unused. The problem is how to fool
the garbage collector without a dummy object
to put in the unused slots.

The client may not be able to construct an object
of the right type easily, and copying a real
element may create references that prevent the
collector removing an object -- unless the design
carefully refills unused slots with the value
of a used slot -- and destroys the array completely
when no slots are used.

Therefore, there is no really good design 'in ocaml':
Dynarray is really a system primitive.

Hmmm.. it was said a C implementation should use VALUE
macro not integer 0. A small C interface will make
that available as a universal NULL value?

I guess this is a C null pointer: ie, an address the collector
will leave alone, rather than an integer the collector
will leave alone?

--
John Max Skaller, mailto:skaller@xxxxxxxxxxxxxx
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe