{"action":"created","issue":{"url":"https://api.github.com/repos/scala-native/scala-native/issues/137","repository_url":"https://api.github.com/repos/scala-native/scala-native","labels_url":"https://api.github.com/repos/scala-native/scala-native/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/scala-native/scala-native/issues/137/comments","events_url":"https://api.github.com/repos/scala-native/scala-native/issues/137/events","html_url":"https://github.com/scala-native/scala-native/pull/137","id":157546467,"number":137,"title":"Call GC malloc atomic to allocate memory for primitive arrays","user":{"login":"fbertra","id":18035,"avatar_url":"https://avatars.githubusercontent.com/u/18035?v=3","gravatar_id":"","url":"https://api.github.com/users/fbertra","html_url":"https://github.com/fbertra","followers_url":"https://api.github.com/users/fbertra/followers","following_url":"https://api.github.com/users/fbertra/following{/other_user}","gists_url":"https://api.github.com/users/fbertra/gists{/gist_id}","starred_url":"https://api.github.com/users/fbertra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbertra/subscriptions","organizations_url":"https://api.github.com/users/fbertra/orgs","repos_url":"https://api.github.com/users/fbertra/repos","events_url":"https://api.github.com/users/fbertra/events{/privacy}","received_events_url":"https://api.github.com/users/fbertra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-30T19:13:23Z","updated_at":"2016-06-02T13:54:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala-native/scala-native/pulls/137","html_url":"https://github.com/scala-native/scala-native/pull/137","diff_url":"https://github.com/scala-native/scala-native/pull/137.diff","patch_url":"https://github.com/scala-native/scala-native/pull/137.patch"},"body":"GC Boehm is a conservative garbage collector.  For the case where the caller knows that he won't store pointer in the allocated memory, GC Boehm provides the GC_malloc_atomic() function.  Scala primitive arrays don't store pointers, so they are candidate to call GC_malloc_atomic.\r\n\r\nNote 1:\r\n\r\nThis PR don't cover other Scala-Native classes potentially compatible with GC_malloc_atomic allocation, like:\r\n\r\n`\r\n@struct class Vec (val x : Double, val y : Double, val z : Double)\r\n`\r\n\r\nNote 2: \r\n\r\nArray[Ptr[_]] are implemented as ObjectArray.\r\n\r\nNote 3:\r\n\r\nThis app test that Boehm GC works as expected with integer arrays https://github.com/fbertra/scala-native-test-gc_malloc_atomic_primitive_arrays\r\n\r\nThis app test that Boehm GC works as expected with Array[Ptr[_]]: https://github.com/fbertra/sn-test-gc_malloc_ptr_arrays\r\n\r\nNote 4:\r\n\r\nBoth test apps share the same problem: Boehm GC is highly random between program executions.  It is necessary to repeat execution until success or failure is detected.  This third app shows the randomness problem is independent of this PR (don't use of Array at all): https://github.com/fbertra/sn-test-boehm\r\n"},"comment":{"url":"https://api.github.com/repos/scala-native/scala-native/issues/comments/223298553","html_url":"https://github.com/scala-native/scala-native/pull/137#issuecomment-223298553","issue_url":"https://api.github.com/repos/scala-native/scala-native/issues/137","id":223298553,"user":{"login":"densh","id":320966,"avatar_url":"https://avatars.githubusercontent.com/u/320966?v=3","gravatar_id":"","url":"https://api.github.com/users/densh","html_url":"https://github.com/densh","followers_url":"https://api.github.com/users/densh/followers","following_url":"https://api.github.com/users/densh/following{/other_user}","gists_url":"https://api.github.com/users/densh/gists{/gist_id}","starred_url":"https://api.github.com/users/densh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/densh/subscriptions","organizations_url":"https://api.github.com/users/densh/orgs","repos_url":"https://api.github.com/users/densh/repos","events_url":"https://api.github.com/users/densh/events{/privacy}","received_events_url":"https://api.github.com/users/densh/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T13:54:23Z","updated_at":"2016-06-02T13:54:23Z","body":"Address suggested changes, reformat, squash and it's good to go! "}}
{"actor":{"display_login":"densh"}}