Browse thread
Ask for a more efficient way to deallocate memory (full version)
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Oliver Bandel <oliver@f...> |
| Subject: | Re: [Caml-list] Ask for a more efficient way to deallocate memory (full version) |
Zitat von Richard Jones <rich@annexia.org>:
> On Mon, Dec 10, 2007 at 05:33:21PM +0100, Oliver Bandel wrote:
> > Zitat von Fabrice Pardo <Fabrice.Pardo@Lpn.cnrs.fr>:
> >
> > [...]
> > > When using these kind of external C functions,
> > > OCaml seems then less comfortable to the programmer
> > > than reference counted languages.
> >
> > I doubt that reference-count is the reason here.
> > perl also uses reference count, but Filehandles
> > and Dirhandles have to be closed with close / closedir.
>
> This isn't true. In Perl file handles are closed at the end of a
> scope if they are no longer used. In other words a Perl-equivalent
> to
> this loop will never use more than a single file descriptor:
>
> while (true) {
> open "foo"
> }
Oh, so I was wrong here. :(
Perl handles Filehandles in a special way (not as other
things in perl), and I thought it also handles Filehandles
different, in respect to reference counting.
Well, some details I've forgotten during the time I rather
used OCaml instead of Perl ;-(
Thanks for the correction.
[...]
> There is a really good paper on this subject -- how ref counting and
> garbage collection are orthogonal language concepts
[...]
That was, what I wanted to express, but my example
was wrong.
Ciao,
Oliver