[gtk-server] Re: GtkTextIter

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Mon, 20 Nov 2006 20:59:18 +0100

Hi John,

> Does the DLL / SO share the same memory issues with the TCP interface?

No, as the TCP interface in fact is an interface to a separate process, while
the DLL/SO is not.

> I was under the impression that all memory is released when a DLL / SO is
dropped.

Well, if your client program stops, the memory in use by that program indeed
should be freed; but it depends on the platform, I guess. I have seen behaviour
in Linux where unused memory remains 'claimed' until the moment the kernel needs
it. For Win32, I am not sure about the behaviour.

Regards
Peter


Citeren John Spikowski <johnspikowski@xxxxxxxxx>:

> Peter,
>
> Does the DLL / SO share the same memory issues with the TCP interface? I was
> under the impression that all memory is release when a DLL / SO is dropped.
>
> John
>
> > -----Original Message-----
> > From: gtk-server-bounce@xxxxxxxxxxxxx
> > [mailto:gtk-server-bounce@xxxxxxxxxxxxx] On Behalf Of Peter van Eerten
> > Sent: Monday, November 20, 2006 3:11 AM
> > To: gtk-server@xxxxxxxxxxxxx
> > Subject: [gtk-server] Re: GtkTextIter
> >
> > Indeed I have used this construction in several situations
> > successfully, also other people did. At my newLisp page you
> > can find some examples (the IDE, the UDP chat and the e-text reader).
> >
> > I am not sure what happens with the 'copy' action though.
> >
> > In fact, it is always troublesome for interpreted languages
> > to reach memory which is addressed by C-pointers. In the
> > current situation the best you can do is using another widget
> > to claim memory.
> >
> > Citeren Ian Haywood <ihaywood@xxxxxxxxxxxx>:
> >
> > > On Monday 20 November 2006 02:46, Peter van Eerten wrote:
> > > > Hi Ian,
> > > >
> > > > For the GtkIter widget you need to workaround your
> > problem with a trick.
> > > > Indeed, there is no such function as a 'gtk_iter_new'. Therefore,
> > > > you must allocate memory with some other widget. I always use
> > > > 'gtk_frame_new' for this.
> > > Thanks for this.
> > >
> > > > Now your variable 'iter' points to allocated memory for a frame,
> > > > where GTK can store information for an iter-structure as well.
> > > Overwriting the frame data?
> > > I'd be worried this would cause memory leaks or similar
> > weird issues
> > > when GTK tries to clean up the frame structure that's been
> > scribbled
> > > over by the text_iter structure. Also we are praying that never
> > > sizeof(GtkTextIter) > sizeof (GtkFrame) However you imply that have
> > > used this technique in practice without problems, is that right?
> > >
> > > I suppose you could immediately pass the frame object to
> > > gtk_text_iter_copy
> > > ()
> > > which would give you a "real" text_iter memory allocation to use.
> > >
> > > Ian
> > >
> >
> >
> > --
> > http://www.gtk-server.org
> >
>
>
>


-- 
http://www.gtk-server.org

Other related posts: