Re: Embedding the VTE Virtual Terminal

2009-12-02 Thread Emmanuel Rodriguez
On Thu, Nov 26, 2009 at 3:07 PM, Stevenix  wrote:

>
> Hi,
>
> I'm writing a Gui+Terminal application, where VTE is embedded on window,
> and
> the GUI Menu Items.
>
> And i'm trying to call this action...
>
> ... calls to this action from the menu... (just fork a 'ls' command)
>
> But i'm unable to get the 'ls' listing ...
>
>  void VimWindow (GtkWidget *widget, gpointer gdata)
>{
>GtkWidget *vte;
>  vte = vte_terminal_new();
>  [b]vte_terminal_fork_command(VTE_TERMINAL(vte), "ls", NULL,
> NULL, ".", FALSE, FALSE, FALSE);[/b]
>}
>
>
Try something like this (untested):
char [][] argv = {
  "ls", NULL
};
vte_terminal_fork_command(VTE_TERMINAL(vte), "ls", argv, NULL, ".", FALSE,
FALSE, FALSE);

If I recall well the first "ls" is actually the name you want the users to
see when they run ps while argv[0] has the name of the program to execute.

-- 
Emmanuel Rodriguez
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_malloc overhead

2009-01-23 Thread Emmanuel Rodriguez
On Tue, Jan 20, 2009 at 12:48 PM, Larry Reaves  wrote:
> On Tue, 2009-01-20 at 09:01 +0100, Martín Vales wrote:
>> BJörn Lindqvist escribió:
>> > Actually, a custom allocator could be useful even in the general case.
>> > Malloc is a system call and has quite bad performance on certain
>> > platforms (windows in particular i think). Something like the gslice
>> > allocator could
>> > Probably improve performance a bit.
>> >
>> gslice i believe use malloc internally. I believe you always need
>> malloc/new-(C/C++) because you depend on ms Windows API.
>>
>> I am not sure if you can build your own malloc because you depend on the
>> operating system.
> Sure, you must malloc to get new memory, but you can malloc bigger than
> what you need and hand out the extra memory later at a much lower cost.
>
I recall reading somewhere that mmap can be used to build custom
memory allocators. If that's true than one can bypass malloc. I think
that you can request memory through mmap by using MAP_ANONYMOUS.

Emmanuel Rodriguez
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list