FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 11-21-2007, 09:09 PM
Miklos Vajna
 
Default [pacman-dev] [PATCH 1/5] Two memleak fixes in pacman.

On Mon, Nov 19, 2007 at 10:45:53PM -0500, "K. Piche" <kpiche@rogers.com> wrote:
> > And that is my point. We don't have a clear definition of what needs
> > freeing and what does not. The name "alpm_db_whatprovides" doesn't
> > indicate at all that its result needs to be freed, and yet something
> > like "alpm_fetch_pkgurl" doesn't need freeing (or does it? I don't
> > know and that seems problematic).
> >
> > So yes, it comes down to documentation and good function naming, which
> > we lack.
>
> You could have a simple convention like GTK/GNOME stuff does: any
> function arguments or returns that are "const" should not be freed by
> the user (or front end in this case). See "Cleanliness" in
> http://developer.gnome.org/doc/guides/programming-guidelines/code-style.html

or just use __attribute__ ((__warn_unused_result__)) on those functions.
obviously those functions' return value must be free'd.

- VMiklos
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 10:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org