00:01:13 | Varriount | Araq: Should I change the FileInfo object to a ref object? |
00:03:38 | * | Fr4n quit (Ping timeout: 260 seconds) |
00:29:48 | bogen | Varriount: well, it is not that simple. "echo 1,2,3,4" produces sprintf ("%s%s%s%s... |
00:31:18 | bogen | what is needed is a sprintf replacement (in C) that does not take a template string |
00:32:40 | bogen | only takes the number of strings. Not the name we would go with, but something like: char *make_new_line_terminated_buffer (int n, ...); |
00:34:34 | bogen | or just: void writeln (int n, ...); It would be laid down once |
00:42:23 | * | Jehan_ quit (Quit: Leaving) |
00:48:24 | bogen | so, I can fix this, it would be with a function that is layed down once somewhere that genEcho generates a call too |
00:48:54 | bogen | it would take n followed by n string addresses and lengths |
00:50:05 | def- | bogen: i would like to see how that performs compared to printf |
00:50:55 | bogen | it would faster, because printf has to parse a bunch of stuff. I could write it up and compare it to sprintf. |
00:51:26 | bogen | comparing to printf is hard to time because the terminal output takes so long |
00:51:38 | def- | redirect the output? |
00:51:56 | bogen | def-: > /dev/null |
00:52:01 | * | Varriount idly wonders if os.nim would better off split into different modules |
00:52:25 | bogen | after verifying that it does indeed output correctly on a small count |
00:53:24 | bogen | def-: yes, I will do that, I will compare the replacement to printf, in the way that printf is used by echo |
00:53:51 | def- | bogen: because to me printf, like it's used in nimrod, looks pretty fast |
00:54:22 | def- | i thought that puts could be faster, but it's not |
00:54:29 | def- | (actually slower) |
00:54:59 | bogen | yeah, the change I want to make is not to improve the echo speed, it is to fix echo stopping on nulls (and to not slow down echo by the fix) |
00:56:29 | def- | Right, makes sense |
01:04:02 | * | EXetoC quit (Quit: WeeChat 0.4.3) |
01:13:03 | * | Fr4n joined #nimrod |
01:18:13 | * | saml_ joined #nimrod |
01:20:20 | * | superfunc joined #nimrod |
01:22:47 | * | adoniscik quit (Ping timeout: 264 seconds) |
01:29:54 | def- | bogen: it shouldn't be used for cstrings though, because then they would need to get traversed twice everytime you print them |
01:31:32 | bogen | def-: no, it is not for cstrings. genEcho has the lengths available, it will pass address and length |
01:31:52 | bogen | plus, with cstrings it would fail, because I can't strlen them if there is a null |
01:31:59 | bogen | the bug would not be fixed |
01:33:22 | bogen | my function takes (N, addr1, len1, ..., addrN, lenN) // or only 1 address len, or even 0 address len |
01:33:56 | bogen | I have it written, I just need to compare it with printf and post the code/results |
02:03:30 | bogen | https://gist.github.com/dschauer/4e9a8294a923f9f2b4b0 "nimecho" takes roughly half the time as printf |
02:10:52 | bogen | and yes, it does work with embedded nuls. https://gist.github.com/dschauer/4e9a8294a923f9f2b4b0 |
02:11:03 | bogen | https://gist.github.com/dschauer/4e9a8294a923f9f2b4b0/b06f851b221b9120f8b9dedb961149d8862c0509 has the time results |
02:11:26 | bogen | so, it is faster (not by much) and it displays nuls |
02:17:15 | def- | bogen: try with -O3, which nimrod uses for -d:release and it's even more impressive |
02:17:34 | def- | I get 3.6s for printf, 0.7 for yours |
02:21:52 | bogen | yeah. I'm on a slow laptop. with -O3, 5.123s for printf, 1.819s for mine |
02:23:00 | flaviu | http://www.joelonsoftware.com/uibook/chapters/fog0000000061.html , worth reading, especially since it sums up my arguments on URIs pretty well |
02:23:57 | bogen | ok, now to replace the call to printf with the call to this one |
02:24:16 | def- | bogen: also, this should work without C++ and stuff like auto I think |
02:24:24 | bogen | it does |
02:24:29 | def- | great |
02:24:35 | bogen | only my wrapper test code uses the auto stuff |
02:25:19 | bogen | it was quick and dirty so I did not have to typedef the function pointer, nimecho is straight C |
02:26:16 | def- | the speedup is pretty great |
02:26:39 | def- | even if you just print a single long string |
02:29:12 | * | xenagi joined #nimrod |
02:35:40 | Varriount | flaviu: Ok, do you have the code the gives us consistancy wrt url handling? |
02:37:56 | flaviu | dom96 already wrote it and its in the stdlib. Not a big fan of the method naming, but my main gripe is that I don't think Araq puts enough focus on familiarity and convention. |
02:53:11 | NimBot | Araq/Nimrod devel 688db0f Grzegorz Adam Hankiewicz [+0 ±1 -0]: Improves tut1.txt with more hyperlinks and minor fixes. |
02:53:11 | NimBot | Araq/Nimrod devel 8aa0be8 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Improves tut2.txt with more hyperlinks. |
02:53:11 | NimBot | Araq/Nimrod devel 1daa54e Grzegorz Adam Hankiewicz [+0 ±2 -0]: Downgrades public module comments to private level.... 3 more lines |
02:53:11 | NimBot | Araq/Nimrod devel f3d785b Grzegorz Adam Hankiewicz [+1 ±2 -0]: Factors exception hierarchy into reusable fragment.... 2 more lines |
02:53:11 | NimBot | 1 more commits. |
02:54:37 | NimBot | Araq/Nimrod devel 00f56b2 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds usage example to typetraits.name().... 2 more lines |
02:54:37 | NimBot | Araq/Nimrod devel 5c9d676 Grzegorz Adam Hankiewicz [+0 ±2 -0]: Adds typetraits to library index and doc build. |
02:54:37 | NimBot | Araq/Nimrod devel 0db99be Varriount [+0 ±3 -0]: Merge pull request #1446 from gradha/pr_links_typetraits_module... 2 more lines |
03:01:42 | * | flaviu quit (Ping timeout: 246 seconds) |
03:06:59 | bogen | anyone here know much about linefmt? used in ccgexprs |
03:22:21 | * | saml_ quit (Quit: Leaving) |
03:26:27 | * | superfunc quit (Ping timeout: 245 seconds) |
03:27:10 | bogen | ok, I figured it out. At least it is generating the calls I intend it to |
03:39:51 | * | superfunc joined #nimrod |
03:48:25 | * | kshlm joined #nimrod |
04:06:51 | * | q66 quit (Quit: Leaving) |
04:09:38 | bogen | well, I got it partially working in nimrod |
04:09:54 | * | xenagi quit (Read error: Connection reset by peer) |
04:10:05 | bogen | it does print strings with nuls |
04:10:36 | bogen | so I have some test cases working |
04:10:45 | bogen | and the right code is being gen'ed |
04:11:02 | bogen | but a lot of stuff is echoing garbage |
04:11:18 | bogen | and some stuff segfaults |
04:26:13 | * | Boscop_ joined #nimrod |
04:29:05 | * | CARAM_ joined #nimrod |
04:29:24 | * | silven_ joined #nimrod |
04:30:58 | * | govg_ joined #nimrod |
04:34:19 | * | nande joined #nimrod |
04:35:33 | * | silven quit (*.net *.split) |
04:35:33 | * | Boscop quit (*.net *.split) |
04:35:34 | * | govg quit (*.net *.split) |
04:35:34 | * | CARAM quit (*.net *.split) |
04:39:52 | * | CARAM_ is now known as CARAM |
05:54:55 | * | adoniscik joined #nimrod |
05:59:14 | * | ics joined #nimrod |
06:05:35 | * | kshlm quit (Remote host closed the connection) |
06:14:42 | * | nande quit (Remote host closed the connection) |
06:25:24 | * | Demos quit (Read error: Connection reset by peer) |
06:37:59 | * | kshlm joined #nimrod |
06:41:33 | Araq | Varriount: please don't make it a ref object, what's the gain |
06:42:09 | Araq | flaviu: the next blog post is called "Next: Designing for People Who Have Better Things To Do With Their Lives" |
06:42:27 | Araq | ah the irony |
06:59:37 | * | gkoller joined #nimrod |
07:06:26 | * | kshlm quit (Remote host closed the connection) |
07:13:31 | * | kunev joined #nimrod |
07:31:16 | * | kshlm joined #nimrod |
07:54:30 | * | adoniscik quit (Ping timeout: 260 seconds) |
08:25:46 | * | zahary joined #nimrod |
08:36:40 | * | ome joined #nimrod |
09:20:59 | * | bjz joined #nimrod |
09:35:04 | * | EXetoC joined #nimrod |
09:56:22 | * | superfunc quit (Ping timeout: 264 seconds) |
10:12:18 | * | [CBR]Unspoken2 quit (Quit: Leaving.) |
10:57:55 | * | [CBR]Unspoken1 joined #nimrod |
10:58:36 | * | saml_ joined #nimrod |
11:54:54 | bogen | Hi Araq |
11:56:23 | * | darkf quit (Quit: Leaving) |
11:59:54 | bogen | Well, I'm learning appf (minimally) and linefmt a bit more. (in regards to code generation). In regards to the nimecho work I'll need to put nimecho in a C library and always link against it. I'll read up on that. |
12:13:01 | EXetoC | so was fwrite agreed upon? |
12:21:49 | * | Araq_ joined #nimrod |
12:22:52 | Araq_ | bogen: you can make a PR, but it will be rejected. this is not how we do it. we don't write C code ;-) |
12:23:11 | Araq_ | reimplement it in nimrod and make it a .compilerProc that the codegen uses |
12:23:16 | bogen | Araq_: agreed |
12:23:58 | bogen | I realized in trying to make the change that I was going contradictory to the DNA of that language and it did not feel write |
12:24:42 | bogen | I need to buld the data structures in nimrod and pass it off to fwrite in a single call |
12:24:55 | bogen | did not feel right... |
12:25:41 | bogen | what I have on my fork I don't intend for anyone to use, the change is not right |
12:26:00 | bogen | is not implemented right |
12:27:04 | Araq_ | well with the .compilerProc you get perfect dead code elimination for free as a nice bonus |
12:31:43 | bogen | yeah. in nimrod code I need to concatenate the strings and the new genEcho would pass them off to fwrite. I also need to make it a different echo initially because echo is a critical component that I can't be breaking and expecting to properly test it. (Which is what I already ran into) |
12:32:54 | Araq_ | you can use alloca and copyMem in nimrod too |
12:37:04 | * | untitaker quit (Ping timeout: 260 seconds) |
12:42:07 | * | untitaker joined #nimrod |
12:52:02 | Araq_ | Varriount: iirc printf is not used anywhere else really |
12:59:34 | * | darkfusion quit (Ping timeout: 240 seconds) |
13:10:04 | * | kshlm quit (Quit: Konversation terminated!) |
13:11:54 | * | saml_ quit (Ping timeout: 272 seconds) |
13:24:41 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237]) |
13:34:23 | * | bogen left #nimrod (#nimrod) |
14:52:03 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:52:17 | * | xenagi joined #nimrod |
14:57:06 | * | bogen joined #nimrod |
15:35:38 | * | bogen left #nimrod (#nimrod) |
15:46:01 | * | ics quit (Ping timeout: 255 seconds) |
15:46:58 | * | ics joined #nimrod |
16:08:05 | * | kunev quit (Quit: leaving) |
16:17:32 | * | Demos joined #nimrod |
16:46:32 | * | ics quit (Ping timeout: 245 seconds) |
16:47:12 | * | ics joined #nimrod |
16:48:44 | * | q66 joined #nimrod |
16:55:22 | * | nande joined #nimrod |
16:58:25 | * | kunev joined #nimrod |
17:06:55 | * | darkfusion joined #nimrod |
17:10:11 | * | adoniscik joined #nimrod |
17:16:17 | * | zahary quit (Quit: Leaving.) |
17:35:34 | * | brson joined #nimrod |
17:46:39 | * | zahary joined #nimrod |
17:49:02 | Demos | I want to overload based on "varness" but I don't seem to be able to, any tricks? |
17:49:17 | Demos | I could cheat and use a typeclass and compiles() but I dont really like that |
17:53:56 | * | kunev quit (Ping timeout: 240 seconds) |
17:54:26 | Araq | proc foo(x: int{lvalue}) |
17:54:30 | Araq | iirc |
17:57:31 | * | ome quit (Quit: Connection closed for inactivity) |
17:58:04 | * | zahary quit (Quit: Leaving.) |
18:06:19 | * | zahary joined #nimrod |
18:06:33 | dom96 | hi |
18:07:04 | * | brson quit (Quit: leaving) |
18:07:13 | * | brson joined #nimrod |
18:09:36 | OrionPK | hi dom |
18:10:44 | dom96 | hi OrionPK |
18:13:27 | * | Trustable joined #nimrod |
18:15:38 | * | kunev joined #nimrod |
18:26:00 | Demos | I solved it with a when statement |
18:26:02 | Demos | works OK |
18:32:34 | * | kunev quit (Ping timeout: 250 seconds) |
18:33:27 | * | kunev joined #nimrod |
18:36:01 | Araq | hmm I noticed my planned light-weight channels are neither light-weight nor necessary |
18:43:48 | reactormonk | Araq, so what's the plan? |
18:44:53 | Araq | I dunno, I'm reading some concurrency "patterns" and see if my model can handle them |
18:46:19 | Araq | but I think what I already have is good enough for version 1, once I fixed the remaining bugs and no new features / data structures are necessary |
18:46:20 | * | kunev quit (Ping timeout: 240 seconds) |
18:47:28 | * | superfunc joined #nimrod |
18:48:09 | * | kunev joined #nimrod |
18:53:01 | * | Jehan_ joined #nimrod |
18:53:39 | * | zahary quit (Quit: Leaving.) |
18:57:39 | Araq | ah hi Jehan_ I lost my creativity, why do I need channels when I have data flow vars? |
18:59:57 | Araq | in most Go examples a channel is captured because a goroutine can't return a value ... this is primitive |
18:59:58 | Jehan_ | From a pure expressiveness point of view, you don't, since you can emulate channels with data flow variables. |
19:00:59 | Jehan_ | However, channels can give you performance gains and the emulation may also be cumbersome. |
19:07:26 | Jehan_ | Simple example of channel usage is a basic implementation of tasks. |
19:07:38 | Jehan_ | You have one channel that is used by all worker tasks. |
19:07:55 | Jehan_ | Creating a new tasks sends a task object to the channel. |
19:08:23 | Jehan_ | Worker threads all receive task objects from the channel (one at a time) and execute the task. |
19:11:59 | * | julienaubert joined #nimrod |
19:12:15 | dom96 | hello julienaubert, welcome! |
19:12:16 | Araq | hi julienaubert welcome |
19:12:30 | julienaubert | Hi! I'm getting an issue that is surprising me, https://gist.github.com/anonymous/12d7b56b9688608f4d25 |
19:12:42 | julienaubert | I get trying read from nil access error when printing out name |
19:12:48 | julienaubert | However the compare works fine |
19:13:24 | julienaubert | Specifically: SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
19:13:47 | julienaubert | On line: echo p.options.macros[i].name |
19:13:52 | julienaubert | How come I do not get that on the line above? |
19:14:28 | * | io2 joined #nimrod |
19:15:14 | def- | julienaubert: you can still compare when it's nil |
19:15:27 | def- | julienaubert: but echo doesn't work with nil |
19:16:46 | julienaubert | hmm I see what you mean, I incorrectly assumed it was macros[i] that was nil. Thanks... now I need to understand why the name is nil |
19:17:03 | Araq | Jehan_: well for the examples I have in mind spawn+flowVar is already the best design, given our constraints |
19:17:51 | Araq | and it's easy enough to pass around arrays of data to mitigate the spawn overhead |
19:19:11 | Jehan_ | Araq: What do you mean by "given our constraints"? |
19:19:26 | Araq | thread local GCs |
19:20:04 | Jehan_ | I see. |
19:21:04 | Jehan_ | If that's always the best design, your examples may only be a subset of all concurrent problems. |
19:21:53 | Araq | well exactly :P is there a list of all concurrent problems available somewhere? ;-) |
19:22:16 | Jehan_ | Araq: Not really. :) |
19:22:36 | Jehan_ | But try search algorithms, for example. |
19:23:09 | Jehan_ | They are often implemented via a distributed hash table. |
19:23:39 | Jehan_ | I.e. there are N hash table threads and M compute threads. |
19:24:13 | Jehan_ | Each compute thread generates successors of a node and sends them to the corresponding hash thread (hash value mod n). |
19:24:56 | Jehan_ | The hash thread checks if they are already in the hash table and if not, stores them and sends them to a random compute thread to find new successors. |
19:25:15 | Jehan_ | That implementation usually depends on channels so that the threads don't stall. |
19:27:49 | Jehan_ | Parfor-based concurrency is great for arrays or other regular data structures, but not so much for dynamic data structures with an unpredictable structure. |
19:28:45 | reactormonk | Araq, nah, no fixing from me, masters thesis |
19:29:00 | Araq | ok good, let me think about it |
19:29:35 | Araq | reactormonk: did I ask you to fix something? |
19:35:47 | * | gsingh93 joined #nimrod |
19:38:01 | * | Matthias247 joined #nimrod |
19:38:55 | reactormonk | Araq, few days back |
19:39:29 | Araq | reactormonk: your masters thesis can wait. do what I told you back then that I can't even remember. |
19:39:47 | reactormonk | ^^ |
19:43:04 | Araq | Jehan_: the thing is not that concurrent hash tables are not useful, but FlowVar[ref Table] lets us easily reuse the existing collections |
19:43:45 | Jehan_ | Araq: It's not about distributed hash tables, but how they're used in this case. |
19:44:38 | Jehan_ | Channels, as I said, are used to prevent threads that do work in segments of short duration from stalling. |
19:48:14 | * | Demos quit (Read error: Connection reset by peer) |
19:53:45 | * | kunev quit (Quit: Lost terminal) |
19:54:51 | * | tinAndi joined #nimrod |
20:07:48 | Araq | julienaubert: what's the problem with patching expandMacro to handle ##? |
20:07:48 | * | flaviu joined #nimrod |
20:16:40 | * | Kelet quit (Ping timeout: 272 seconds) |
20:19:23 | * | ics quit (Ping timeout: 240 seconds) |
20:20:54 | * | ics joined #nimrod |
20:26:26 | julienaubert | Araq, before I do that, I realized I have to handle expanding a macro-argument which is another macro. E.g. MANGLE_DOUBLE(x,y) where #define MANGLE_DOUBLE(x,y) typedef y CAT(x,y) |
20:27:02 | julienaubert | and so reading up the code to understand how I could achieve that. Any hint appreciated :) |
20:27:10 | julienaubert | (and thanks for the answer in the forum!) |
20:27:26 | Araq | there is no need, it already expands recursively, afaict |
20:28:37 | julienaubert | hmm |
20:30:09 | Araq | getTok has a while loop for exactly this case |
20:30:42 | Araq | btw the preprocessor and parser have nothing to do with the language standard |
20:30:56 | Araq | it's a best effort parser full of heuristics |
20:31:28 | Araq | but it works pretty well once you accepted that you need to modify the header files |
20:32:29 | julienaubert | Yeh I see what you mean. Interestingly it does not work on my test file though |
20:34:02 | julienaubert | I mean: I would expect it to see that CAT is a macro to be expanded once it is expanding MANGLE_DOUBLE |
20:35:48 | Araq | well it happens later |
20:36:00 | Araq | it expands to typedef y CAT(x, y) |
20:36:13 | Araq | so it inserts 2 tokesn before it comes to CAT |
20:36:34 | julienaubert | OK cause right now it gives an error on ")" that it expected an identifier |
20:36:51 | * | silven_ is now known as silven |
20:39:17 | julienaubert | I.e., https://gist.github.com/anonymous/dc5af36f040b5e99325f c2nim/test.c(12, 29) Error: identifier expected, but found ')' |
20:41:47 | julienaubert | another issue, is that I am not able to compile with the debugger |
20:42:47 | * | Kelet joined #nimrod |
20:43:54 | * | tinAndi quit (Quit: ChatZilla 0.9.90.1 [Firefox 31.0/20140716183446]) |
20:43:55 | Araq | julienaubert: use --debugInfo and gdb |
20:44:17 | Araq | the debugger is barely maintained, unfortunately |
20:44:37 | Araq | that said, I still haven't given up on it, so please submit a bug report |
20:46:03 | julienaubert | Ah cool thanks |
20:46:12 | julienaubert | OK will do! |
20:50:21 | julienaubert | https://github.com/Araq/Nimrod/issues/1466 |
20:52:16 | * | Boscop_ is now known as Boscop |
20:52:18 | * | Boscop quit (Changing host) |
20:52:18 | * | Boscop joined #nimrod |
20:57:54 | flaviu | julienaubert: I also like to use --lineDir:on |
20:58:15 | julienaubert | thanks |
20:58:43 | * | Trustable quit (Quit: Leaving) |
21:03:54 | Araq | julienaubert: yeah, I see what you mean |
21:04:08 | Araq | only MANGLE_DOUBLE gets expanded for some reason |
21:06:05 | * | Fx00F joined #nimrod |
21:07:03 | julienaubert | Mm did not manage to understand why yet |
21:07:28 | julienaubert | and, now I need to leave. Thanks for the help and hints! |
21:07:42 | Araq | well I'm fixing it |
21:07:57 | Araq | challenge accepted! ;-) |
21:12:34 | * | Trustable joined #nimrod |
21:17:56 | julienaubert | :D that's great, thx. I will study your commit |
21:20:17 | Varriount | So, today I was using python, and missed Nimrod's templates |
21:21:08 | * | Trustable quit (Quit: Leaving) |
21:21:25 | * | julienaubert quit (Remote host closed the connection) |
21:23:22 | Varriount | Araq: https://github.com/Araq/Nimrod/issues/1424 |
21:26:00 | Araq | Varriount: I replied |
21:30:15 | Araq | Varriount: I usually miss set[T] and templates and 'case' most |
21:31:18 | Varriount | Araq: Yeah, case was missed as well. I was doing GUI work, linking selection options to page ID's |
21:38:54 | * | xenagi quit (Quit: Leaving) |
21:49:24 | Varriount | Araq: Ping |
21:49:34 | Araq | pong |
21:50:11 | Varriount | Araq: The casting bug seems the be already fixed. I didn't do anything.. |
21:50:31 | Varriount | Oh wait, nevermind |
21:55:55 | Varriount | Araq: I submitted a PR to fix the cast[openarray[int]] problem |
21:56:37 | Araq | thank you |
21:59:58 | Araq | Varriount: I'm not sure this fix is correct |
22:00:31 | Varriount | Oh? |
22:01:41 | Araq | well for a start, types suck and you have to something like t.skipTypes(abstractVarInst).kind == tyOpenArray |
22:01:59 | Araq | but I wonder if some usages of casting to openarray make sense |
22:04:17 | Varriount | The only usage I can think of is if you recieve a pointer that was originally an openarray. |
22:05:28 | Varriount | Araq: Any particular reason why skipTypes only scans a series of last child nodes, rather than the entire node tree? |
22:05:33 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
22:07:24 | Varriount | I mean, is there something significant about the last child node? |
22:07:57 | Araq | well the type graph is designed this way |
22:08:30 | Araq | it only needs to look at the last child |
22:08:52 | Araq | when this doesn't work, you can't use skipTypes |
22:09:09 | Araq | but guess what, it almost always works |
22:19:55 | Araq | but ok |
22:20:08 | Araq | I think apart from the skipTypes issue your patch is fine |
22:22:48 | Araq | aha! |
22:22:53 | Araq | got the c2nim bug |
22:23:03 | Araq | damn this is evil |
22:39:27 | * | adoniscik quit (Ping timeout: 245 seconds) |
22:43:16 | * | Demos joined #nimrod |
22:47:21 | Araq | Jehan_: do you think it's same to overwrite boehm's memory header temporarily with a forwarding pointer for deepCopy? |
22:47:37 | Araq | *sane |
22:48:43 | Jehan_ | Umm, explain? |
22:49:41 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
22:50:44 | Jehan_ | Oh, I think I see what implementation you're using. |
22:51:17 | Jehan_ | Don't store forward references in memory allocated with GC_malloc_atomic(). |
22:52:55 | Jehan_ | Unless they're kept live through another reference. |
22:52:58 | * | darkf joined #nimrod |
22:52:59 | Araq | I only use that for strings and these do not get a forwarding pointer anyway |
22:53:49 | Jehan_ | If you overwrite an existing pointer in an object, the object has to be kept live from someplace else. |
22:54:42 | Araq | well what does the header contain? |
22:54:54 | Jehan_ | What header? |
22:55:34 | Jehan_ | There's a per hblk header, but not one associated with allocated blocks. |
22:56:37 | Jehan_ | The Boehm GC manages memory in 4K or 8K hblk (heap blocks). |
22:57:28 | Araq | ok this means I'm overwriting some actual data then, not good |
22:57:33 | Jehan_ | Each hblk has an associated meta information block, telling you for small allocations what the size of allocated blocks within the hblk is, which are allocared, etc. |
22:57:56 | Araq | p = someAlloc(sizeof(...)) |
22:57:58 | Jehan_ | There's an additional data structure that maps conservative pointers to hblk headers. |
22:58:07 | Araq | usually there is a header at p[-1] |
22:58:19 | Jehan_ | Yup, but not with the Boehm GC. |
22:58:57 | Araq | well this means I need some external table to detect cycles for deepCopy |
22:59:04 | Jehan_ | This allows it to allocate blocks of 2*wordsize with no additional overhead (except the metainfo per hlbk stuff). |
22:59:44 | Araq | and this table needs to be able to grow, so it itself needs to be heap allocated etc ... |
23:00:03 | Araq | very messy for such a rarely used feature |
23:00:25 | * | adoniscik joined #nimrod |
23:00:41 | Araq | hence I store a forwarding pointer instead, which I know my GC "allows" |
23:01:08 | Jehan_ | Yup. |
23:02:13 | Jehan_ | One option is to have an extra word at the end of each allocated object (or beginning, if you want to play around with displacements). |
23:03:19 | NimBot | Araq/Nimrod devel a41be80 def [+0 ±1 -0]: Include string.h for strlen with cpp backend |
23:03:19 | NimBot | Araq/Nimrod devel 9bb7393 def [+0 ±1 -0]: Also include string.h for strlen for C backend |
23:03:19 | NimBot | Araq/Nimrod devel 4ce127b Andreas Rumpf [+0 ±1 -0]: Merge pull request #1465 from def-/cpp-cstring-len... 2 more lines |
23:05:16 | Jehan_ | If you're using all_interior_pointers at the moment (which you probably are, it's the default), you can probably drop that and come out with the same total memory footprint. |
23:07:06 | Araq | Varriount: if you make DeviceId public, make it a distinct type on windows |
23:07:20 | Araq | same for FileId |
23:09:03 | Araq | also don't do the fileExists check on unix, it's not necessary |
23:09:11 | Araq | also it's wrong |
23:09:23 | Araq | isHidden("../../foo") == true ? |
23:09:51 | Araq | isHidden("./foo") == true? |
23:15:17 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:21:43 | * | Varriount quit (Read error: Connection reset by peer) |
23:22:10 | * | Varriount joined #nimrod |
23:28:26 | * | bogen joined #nimrod |
23:51:32 | * | nande quit (Remote host closed the connection) |
23:58:33 | * | flaviu quit (Read error: Connection reset by peer) |