/srv/irclogs.ubuntu.com/2008/03/13/#upstart.txt

KeybukI think that the right way to approach this is autogenerated code10:07
Keybukhave something that turns an xml file into either proxy functions or marshal functions10:07
ion_XSLT?10:12
Keybukprobably just Python ;)10:12
* ion_ once made an evil m4→xslt→{makefile,graphviz} converter thing. :-P10:14
Keybukheh10:15
KeybukI never really understood xslt10:15
ion_http://gitweb.heh.fi/?p=ion/heroes-scrape.git;f=pipeline.m4;hb=HEAD is converted to XML by http://gitweb.heh.fi/?p=ion/heroes-scrape.git;f=pipeline/to-xml.m4;hb=HEAD which is converted to a makefile by http://gitweb.heh.fi/?p=ion/heroes-scrape.git;f=pipeline/to-mk.xsl;hb=HEAD (and it also spouts this graph, http://heh.fi/heroes/heroes-scrape/pipeline.html). :-P10:19
=== thom_ is now known as thom
Keybukion_: that's intense!13:47
Keybuktalking of which13:47
KeybukI was thinking about nih_ref and nih_unref again last night13:47
Keybukthere's some thorny bits of code in Upstart that are basically compensating for the lack of it13:47
ion_Ok13:48
Keybukso I was thinking13:53
Keybukin general principle, nih_ref and nih_unref should just work13:53
Keybukif you pass NULL as the context, the default 1 reference is yours13:53
Keybukif you pass non-NULL, the reference is not yours13:53
ion_Yeah13:54
Keybukthe problem is that you have to remember you ref'd and unref in destroy()13:58
Keybukso for the case I'm thinking13:58
Keybukevent_new "steals" the env array you pass it13:58
Keybukwith the ref/unref model, it would have to ref it, at which point it'd have to unref it again13:59
Keybuklosing the niceness of the hierarchical bit13:59
Keybukso it'd certainly work13:59
Keybukbut I'm wondering if instead, we don't want each allocation to have multiple parent contexts?13:59
Keybukyou pass one when you create it13:59
Keybukand any other parent can adopt it13:59
Keybukwhen a parent is freed, it orphans its children14:00
Keybukif they have other parents, then they're fine14:00
Keybukif they are truly orphaned, then they're freed14:00
ion_Yeah, many-to-many relationships would be nice.14:00
Keybukdoing those O(1) might be hard though14:01
ion_Would we need anything else than a list of parents for each child and list of children for each parent?14:01
Keybukno14:06
Keybukbut for each parent/child relationship, we'd need n pointers14:06
Keybukso the context would grow for each relationship you add14:06
ion_Yep14:07
ion_How about a hash table with key and value being the pointer?14:09
ion_Or is that a stupid idea? :-)14:09
ion_(Or a hash-like table with only keys – say, a Hashish table.)14:12
KeybukI was thinking something like that14:18
Keybukinstead of putting the context at the beginning of the block, just have a lookup table14:18
Keybukthat'd mean nih_alloc could adopt blocks allocated elsewhere14:18
ion_A Finnish ISP defines IRC as “Inter Relay Chat – Internet’s dating service”. http://sanasto.elisa.fi/showWord.cfm?id=1079&languageId=116:26
KeybukIRC is Finnish16:28
ion_Yes.16:29

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!