Re: Glib resource framework



* Alexander Larsson <alexl redhat com> schrieb:
> On Wed, 2011-12-21 at 17:47 -0500, Alexander Larsson wrote:
> > I just finished a one-day hackathon to add a resource framework to glib, its
> > somewhat working if not very polished. Its in the "resources" branch in glib
> > git.
> > 
> > I think this could be very useful in many places, for instance to ship built-in 
> > css files, gtk builder files, win32 theme images etc in a way that still makes libraries 
> > relocatable (and avoids potential for runtime errors due to not found files).
> > 
> > Feedback on the concept and the code welcome... Time to zzzzleep...
> 
> Ok, I pushed a few changes to the API and a few new features/fixes:
> 
> * On linux the resources end up in separate named readonly data
>   sections:
> 
>   readelf -S gio/tests/.libs/resources
>   ...
>   [16] .gresource.test2  PROGBITS         0000000000402d38  00002d38
>        00000000000000ac  0000000000000000   A       0     0     8
>   ...

hmm, what about non-ELF platforms ?

> If we get called on module unload things a much better, we will
> generally not crash, and we will properly unregister the resources for
> the module. However, any outstanding data (GBytes or GInputStreams) from
> the resource will suddenly see their backing go away. We could possibly
> keep track of these and neuter the objects, but if you have e.g. a raw
> pointer to the data then there is no way to get notified of this.

Reinventing standard kernel features in userland, amazing ...


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt metux de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------


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