[panda-users] OSI framework free_* callbacks

Manolis Stamatogiannakis mstamat at gmail.com
Fri Feb 6 10:27:38 EST 2015


Are there any other popular memory allocators apart from libc malloc that
would cause problems in that case?

For convenience, I usually prefer glib's memory functions. But I believe
that under the hood, they also use malloc, so there won't be any problems
mixing them with direct calls to malloc/free.

Maybe we can keep the callbacks in place for cases where the OS-specific
plugin does anything fancy. If no callback is registered, then the default
free code will be used.

Thanks,
Manolis

2015-02-03 19:43 GMT+01:00 Brendan Dolan-Gavitt <brendandg at gatech.edu>:

> I did this out of perhaps too much caution. The thought was that if
> plugins were compiled at different times, they might end up relying on
> different versions of libc, which could have changed the
> implementation of malloc/free. Thus, it might not be safe to try to
> free() memory that was malloc'd by another plugin. The basic idea is
> described here:
>
> http://blogs.msdn.com/b/oldnewthing/archive/2006/09/15/755966.aspx
>
> However, under the assumption that plugins all get compiled at the
> same time (and hence always linked to the same libc), we can probably
> get away with doing the freeing inside of os_intro.c.
>
> -Brendan
>
> On Tue, Feb 3, 2015 at 1:15 PM, Manolis Stamatogiannakis
> <mstamat at gmail.com> wrote:
> > Hello,
> >
> > Is there any reason that the free_*() functions in
> > panda_plugins/osi/os_intro.c are only placeholders and the actual
> > functionality has to be implemented by the OS-specific plugins?
> >
> > There's nothing OS-specific in the data types defined in osi_types.h, so
> > these functions could be easily implemented within os_intro.c.
> >
> > Thanks,
> > Manolis
> >
> > _______________________________________________
> > panda-users mailing list
> > panda-users at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/panda-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/panda-users/attachments/20150206/9ed9e422/attachment-0001.htm


More information about the panda-users mailing list