Re: A proposal for Midnight Commander

> :%s/g_malloc/malloc/g
> :%s/g_free/free/g
> And you are quite a lot closer to porting from glib to glibc. After this
> do that:
> :%s/g_strdup/strdup/g
> :%s/g_strconcat/<with the old copy_string function>/g

Even easier:
#define g_malloc  malloc

The advantage of this approach is that there will be no change in many files
and,  if desired, we can change implementation of  these simple functions,
e.g. we can make g_malloc to bail out if we run out of memory.
But this is just a matter of taste which approach to chose for these simple

> And you ported Midnight Commander for over 60-70% to glibc again. This
> was only a quick peek I did. A few things need a bit more investigation

The remaining 30% of mc's glib code usage must be the list code, and I think
the best way to handle it is just to use glib's implementation.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]