From: Christian Laursen <xi@borderworlds.dk>
To: mlmmj@mlmmj.org
Subject: Re: memory management in mlmmj
Date: Wed, 23 Mar 2005 22:44:36 +0000 [thread overview]
Message-ID: <86vf7it223.fsf@borg.borderworlds.dk> (raw)
In-Reply-To: <20050323212830.GA21199@mopo.webdmz.tv2.dk>
"Morten K. Poulsen" <morten@afdelingp.dk> writes:
> Memory management makes up quite a large portion of the code, especially
> freeing memory at error conditions. How about we sacrifice a tiny bit of memory
> and performance and automate it?
>
> The basic idea here is to have scopes of dynamic memory, a lot like local
> variables. At the beginning of each function we could begin a scope, and at the
> end of a function (and at returns) we could end it. If we need to return a
> pointer to some memory, we could move that chunk of memory up to the parent
> scope. I think that would work well, and make the code a lot more readable.
>
> It is not new, I think PHP does something like this (where a request is the
> scope).
Apache has also done something similar for years. It is probably available in
APR, but it's probably not feasible to link against that monstrosity.
> Is it a bad idea?
Personally I like it, but since I'm not touching much of the code in question
my opinion doesn't count that much.
--
Christian Laursen
next prev parent reply other threads:[~2005-03-23 22:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-23 21:28 memory management in mlmmj Morten K. Poulsen
2005-03-23 22:44 ` Christian Laursen [this message]
2005-03-24 0:38 ` Mads Martin Joergensen
2005-03-24 8:04 ` Mads Toftum
2005-03-24 8:07 ` Mads Martin Joergensen
2005-03-24 8:11 ` Mads Toftum
2005-03-24 8:14 ` Mads Martin Joergensen
2005-03-29 9:24 ` Morten K. Poulsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86vf7it223.fsf@borg.borderworlds.dk \
--to=xi@borderworlds.dk \
--cc=mlmmj@mlmmj.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.