Re: Pointer/screen problems, part two

On Wed, 2 Oct 2002, Owen Taylor wrote:

> > and g_mem_chunk_destroy() is basically broken there.
> > mem chunks _have_ to be replaced in a future memory system
> > rewrite, ading something like g_mem_chunk_owns() simply
> > adds up to the compatibility maintenance nightmare mem chunks
> > already introduce.
> > gosh, why wasn't the mem chunk API correctly deprecated
> > before 2.0? i could swear i sent an email out on this.
> You mean why wasn't g_mem_chunk_destroy() deprecated? 


> > > Then we can have a:
> > > 
> > >  void gdk_event_set_screen (GdkEvent *event);
> > 
> > if this is only going to work on events that are allocated
> > via _gdk_event_new() and thusly freed with gdk_event_free(),
> > i don't see why you couldn't simply use g_datalist_id_set_data_full().

sorry, s/g_datalist_id_set_data_full/g_dataset_id_set_data_full/

> A pretty big percentage of events will actually have this extra 
> information (all motion notifies, and motion notifies are a big
> percentage of events).
> So, if I need to keep track of "is this an allocated event" using 
> a hash table, it probably make sense to just to use a separate
> hash table rather than incurring the overhead of separate
> blocks to hold the extra information and GData blocks. 

owen, this kind of hackery (attaching extra data to "foreign"
structures) is exactly why datasets where introduced. and the
current implementation is also pretty fast if you're not using
too long data lists (which prolly isn't the case for events).
in light of the long term plan to simply move screen into the
event structure for 2.4, datasets are good and easy enough
to use for migration (in the end, that's what they exist
for and provide a hash table for you already),

> > > That works for events allocated with _gdk_event_new()
> > > but not for stack allocated evens.
> > 
> > not that i particularly like the idea of gdk_event_set_screen() not
> > working on stack located events, but then that's due to the
> > brokeness of allowing events not allocated through _gdk_event_new()
> > in the first place. so if you do implement gdk_event_set_screen()
> > based on datasets, you should deprecate event allocations
> > other than through _gdk_event_new() on the way, so for 3.0, we
> > have at least the ability to put a screen fields into GdkEvent.
> First step in doing that would be adding a public gdk_event_new()...

erm, yeah, i overlooked that, make it public ;)

> Regards,
>                                         Owen


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