{"action":"created","comment":{"url":"https://api.github.com/repos/indutny/mmap.js/pulls/comments/26209440","id":26209440,"diff_hunk":"@@ -85,9 +86,55 @@ NAN_METHOD(AlignedAlloc) {\n }\n \n \n+NAN_METHOD(Sync) {\n+  NanScope();\n+  char* data = node::Buffer::Data(args[0]->ToObject());\n+  size_t length =  node::Buffer::Length(args[0]->ToObject());\n+\n+  if (args.Length() > 1) {\n+    // optional argument: offset\n+    const size_t offset = args[1]->Uint32Value();\n+    if (length <= offset) {\n+      return NanThrowRangeError(\"Offset out of bounds\");\n+    }\n+    else if (offset > 0 && (offset % getpagesize())) {","path":"src/mmap.cc","position":23,"original_position":23,"commit_id":"f8f13cac4f616c615fe1642cf00b36212b9bd956","original_commit_id":"f8f13cac4f616c615fe1642cf00b36212b9bd956","user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"body":"Please place `else` on a previous line here and below.","created_at":"2015-03-11T13:03:46Z","updated_at":"2015-03-11T13:03:46Z","html_url":"https://github.com/indutny/mmap.js/pull/1#discussion_r26209440","pull_request_url":"https://api.github.com/repos/indutny/mmap.js/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/comments/26209440"},"html":{"href":"https://github.com/indutny/mmap.js/pull/1#discussion_r26209440"},"pull_request":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/indutny/mmap.js/pulls/1","id":28932984,"html_url":"https://github.com/indutny/mmap.js/pull/1","diff_url":"https://github.com/indutny/mmap.js/pull/1.diff","patch_url":"https://github.com/indutny/mmap.js/pull/1.patch","issue_url":"https://api.github.com/repos/indutny/mmap.js/issues/1","number":1,"state":"open","locked":false,"title":"Add msync support","user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"body":"First ever time writing C/C++, so apologies if I've made any terrible faux pas.\r\n\r\n> Edit: This now works!","created_at":"2015-02-09T16:11:47Z","updated_at":"2015-03-11T13:03:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29223cb1583b9636e688c5318f3dbedc7352961d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/indutny/mmap.js/pulls/1/commits","review_comments_url":"https://api.github.com/repos/indutny/mmap.js/pulls/1/comments","review_comment_url":"https://api.github.com/repos/indutny/mmap.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indutny/mmap.js/issues/1/comments","statuses_url":"https://api.github.com/repos/indutny/mmap.js/statuses/f8f13cac4f616c615fe1642cf00b36212b9bd956","head":{"label":"codemix:add-msync","ref":"add-msync","sha":"f8f13cac4f616c615fe1642cf00b36212b9bd956","user":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"repo":{"id":30537523,"name":"mmap.js","full_name":"codemix/mmap.js","owner":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codemix/mmap.js","description":"Working mmap bindings for node.js","fork":true,"url":"https://api.github.com/repos/codemix/mmap.js","forks_url":"https://api.github.com/repos/codemix/mmap.js/forks","keys_url":"https://api.github.com/repos/codemix/mmap.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codemix/mmap.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codemix/mmap.js/teams","hooks_url":"https://api.github.com/repos/codemix/mmap.js/hooks","issue_events_url":"https://api.github.com/repos/codemix/mmap.js/issues/events{/number}","events_url":"https://api.github.com/repos/codemix/mmap.js/events","assignees_url":"https://api.github.com/repos/codemix/mmap.js/assignees{/user}","branches_url":"https://api.github.com/repos/codemix/mmap.js/branches{/branch}","tags_url":"https://api.github.com/repos/codemix/mmap.js/tags","blobs_url":"https://api.github.com/repos/codemix/mmap.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codemix/mmap.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codemix/mmap.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/codemix/mmap.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codemix/mmap.js/statuses/{sha}","languages_url":"https://api.github.com/repos/codemix/mmap.js/languages","stargazers_url":"https://api.github.com/repos/codemix/mmap.js/stargazers","contributors_url":"https://api.github.com/repos/codemix/mmap.js/contributors","subscribers_url":"https://api.github.com/repos/codemix/mmap.js/subscribers","subscription_url":"https://api.github.com/repos/codemix/mmap.js/subscription","commits_url":"https://api.github.com/repos/codemix/mmap.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/codemix/mmap.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/codemix/mmap.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/codemix/mmap.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/codemix/mmap.js/contents/{+path}","compare_url":"https://api.github.com/repos/codemix/mmap.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codemix/mmap.js/merges","archive_url":"https://api.github.com/repos/codemix/mmap.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codemix/mmap.js/downloads","issues_url":"https://api.github.com/repos/codemix/mmap.js/issues{/number}","pulls_url":"https://api.github.com/repos/codemix/mmap.js/pulls{/number}","milestones_url":"https://api.github.com/repos/codemix/mmap.js/milestones{/number}","notifications_url":"https://api.github.com/repos/codemix/mmap.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codemix/mmap.js/labels{/name}","releases_url":"https://api.github.com/repos/codemix/mmap.js/releases{/id}","created_at":"2015-02-09T13:40:51Z","updated_at":"2015-02-09T13:40:52Z","pushed_at":"2015-03-11T11:59:44Z","git_url":"git://github.com/codemix/mmap.js.git","ssh_url":"git@github.com:codemix/mmap.js.git","clone_url":"https://github.com/codemix/mmap.js.git","svn_url":"https://github.com/codemix/mmap.js","homepage":null,"size":105,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"indutny:master","ref":"master","sha":"487ac765abb29027208626fa9589964cea0caf87","user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"repo":{"id":25092911,"name":"mmap.js","full_name":"indutny/mmap.js","owner":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/indutny/mmap.js","description":"Working mmap bindings for node.js","fork":false,"url":"https://api.github.com/repos/indutny/mmap.js","forks_url":"https://api.github.com/repos/indutny/mmap.js/forks","keys_url":"https://api.github.com/repos/indutny/mmap.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indutny/mmap.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indutny/mmap.js/teams","hooks_url":"https://api.github.com/repos/indutny/mmap.js/hooks","issue_events_url":"https://api.github.com/repos/indutny/mmap.js/issues/events{/number}","events_url":"https://api.github.com/repos/indutny/mmap.js/events","assignees_url":"https://api.github.com/repos/indutny/mmap.js/assignees{/user}","branches_url":"https://api.github.com/repos/indutny/mmap.js/branches{/branch}","tags_url":"https://api.github.com/repos/indutny/mmap.js/tags","blobs_url":"https://api.github.com/repos/indutny/mmap.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indutny/mmap.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indutny/mmap.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/indutny/mmap.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indutny/mmap.js/statuses/{sha}","languages_url":"https://api.github.com/repos/indutny/mmap.js/languages","stargazers_url":"https://api.github.com/repos/indutny/mmap.js/stargazers","contributors_url":"https://api.github.com/repos/indutny/mmap.js/contributors","subscribers_url":"https://api.github.com/repos/indutny/mmap.js/subscribers","subscription_url":"https://api.github.com/repos/indutny/mmap.js/subscription","commits_url":"https://api.github.com/repos/indutny/mmap.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/indutny/mmap.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/indutny/mmap.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/indutny/mmap.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/indutny/mmap.js/contents/{+path}","compare_url":"https://api.github.com/repos/indutny/mmap.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indutny/mmap.js/merges","archive_url":"https://api.github.com/repos/indutny/mmap.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indutny/mmap.js/downloads","issues_url":"https://api.github.com/repos/indutny/mmap.js/issues{/number}","pulls_url":"https://api.github.com/repos/indutny/mmap.js/pulls{/number}","milestones_url":"https://api.github.com/repos/indutny/mmap.js/milestones{/number}","notifications_url":"https://api.github.com/repos/indutny/mmap.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indutny/mmap.js/labels{/name}","releases_url":"https://api.github.com/repos/indutny/mmap.js/releases{/id}","created_at":"2014-10-11T19:50:07Z","updated_at":"2015-03-02T17:20:13Z","pushed_at":"2015-02-28T16:27:08Z","git_url":"git://github.com/indutny/mmap.js.git","ssh_url":"git@github.com:indutny/mmap.js.git","clone_url":"https://github.com/indutny/mmap.js.git","svn_url":"https://github.com/indutny/mmap.js","homepage":null,"size":136,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/1"},"html":{"href":"https://github.com/indutny/mmap.js/pull/1"},"issue":{"href":"https://api.github.com/repos/indutny/mmap.js/issues/1"},"comments":{"href":"https://api.github.com/repos/indutny/mmap.js/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indutny/mmap.js/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/indutny/mmap.js/statuses/f8f13cac4f616c615fe1642cf00b36212b9bd956"}}}}