Conversation with #inferno at Fri Apr 15 05:28:43 2011 on powerman-asdf@irc.freenode.net (irc) (05:47:45) kristianpaul left the room. (06:07:35) perdix [~mkhl@sxemacs/devel/perdix] entered the room. (09:37:50) eno left the room (quit: Ping timeout: 276 seconds). (09:38:48) eno [~eno@nslu2-linux/eno] entered the room. (12:53:12) robot12 [~KAZZhilki@proxy10.ts.fujitsu.com] entered the room. (13:48:40) Fish- [~Fish@coss6.exosec.net] entered the room. (13:50:18) tensai_cirno [~cirno@77.232.15.216] entered the room. (13:51:38) Fish left the room (quit: Ping timeout: 264 seconds). (15:53:32) GriffenJBS left the room (quit: Ping timeout: 276 seconds). (15:59:59) GriffenJBS [~john@adsl-32-33-168.mia.bellsouth.net] entered the room. (16:24:00) tensai_cirno left the room (quit: Quit: Leaving). (19:10:05) robot12 left the room. (19:53:59) KillerX [~anant@nat/mozilla/x-ioulkcovpelkelwy] entered the room. (20:30:03) base2design left the room (quit: Quit: base2design). (20:34:11) Fish [~Fish@9fans.fr] entered the room. (21:25:27) tensai_cirno [~cirno@77.232.15.216] entered the room. (21:48:29) perdix left the room (quit: Remote host closed the connection). (22:33:59) perdix [~mkhl@sxemacs/devel/perdix] entered the room. (22:34:22) perdix left the room (quit: Remote host closed the connection). (22:34:41) perdix [~mkhl@sxemacs/devel/perdix] entered the room. (23:35:05) powerman: mjl-: can you give me the hint where I can find implementation details for things like Array or List? (23:35:34) powerman: for example, I'm now implementing json.jvarray() in C (23:35:54) powerman: in Limbo it's single-line func, just: return ref JValue.Array(a); (23:37:38) powerman: in C, it looks like "a" param should be _copied_ (memmove a->data), PLUS ref count for all elements of a should be incremented (for(ilen){incmem}) (23:38:55) powerman: there are arraycpy() func in libinterp/heap.c which is doing this, but… it doesn't exported by include/interp.h, so I'm not sure is it right way to use it (23:40:57) powerman: now, I have to implement json.jvobject() in C. same thing - I think I'll have to create new List* and copy jvobject()'s param (list of (string, ref JValue)) to that list. probably I'll also have to stringdup() strings in that list, and incmem() JValues. (23:41:42) powerman: but that's just a guess. I'd like to know for sure, and looks like only way is check implementation details for Array and List… (23:45:02) powerman: I was hoping it's enough to do something like incmem(a) for Array*, so C implementation will be as simple as Limbo one - just an assignment and increment refcounter. But looks like this doesn't work for Array*. (23:51:08) powerman: another unrelated question is about types like Tarray - looks like they used to count amount of Array structs in heap, but I don't understood why this is needed? it doesn't looks like this somehow may helps gc, so what's these types for? (23:51:35) KillerX left the room (quit: Quit: KillerX). (23:51:57) KillerX [~anant@2620:101:8003:200:21b:63ff:fea5:86ee] entered the room. (00:04:55) Fish left the room (quit: Quit: So Long, and Thanks for All the Fish). (02:26:01) KillerX left the room (quit: Quit: KillerX). (03:13:22) powerman: my best guess about Tarray: it's an optimization. they probably was designed to exists only if there some Array* structs exists in heap. but this mean, while creating new Array* we have to check is it first Array*, and if yes create also Tarray. this way when latest Array* will be freed, Tarray also will be freed. and when we'll create next ope Array* we'll have to create also Tarray, again. (03:17:28) powerman: but later was decided to let Tarray exists anyway, no matter is there are some Array* exists or not. so it was created with ref=1, simulating there are some ghost Array* exists which refer to this Tarray. so we doesn't have to check is we creating first Array* and is we should also create Tarray. but we still have to keep doing senseless Tarray.ref++ because freetype() is still doing Tarray.ref-- and will free it if ref==0. (03:20:29) powerman: maybe dis use Tsometype for user-defined adt, and does create Tsometype with ref=0, do avoid leaving it in memory after all user's adt of sometype will be freed. (03:27:29) perdiy [~mkhl@sxemacs/devel/perdix] entered the room. (03:28:52) perdix left the room (quit: Ping timeout: 246 seconds). (05:29:12) The account has disconnected and you are no longer in this chat. You will be automatically rejoined in the chat when the account reconnects.