{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/io.js/pulls/comments/30920453","id":30920453,"diff_hunk":"@@ -0,0 +1,34 @@\n+'use strict';\n+\n+const binding = process.binding('dlopen');\n+\n+exports.dlopen = function dlopen(name) {\n+  var lib = new Buffer(binding.sizeof_uv_lib_t);","path":"lib/dlopen.js","position":6,"original_position":6,"commit_id":"b7aaf11e818b0d40e05063e13b1e7f23e89cbc9b","original_commit_id":"b7aaf11e818b0d40e05063e13b1e7f23e89cbc9b","user":{"login":"TooTallNate","id":71256,"avatar_url":"https://avatars.githubusercontent.com/u/71256?v=3","gravatar_id":"","url":"https://api.github.com/users/TooTallNate","html_url":"https://github.com/TooTallNate","followers_url":"https://api.github.com/users/TooTallNate/followers","following_url":"https://api.github.com/users/TooTallNate/following{/other_user}","gists_url":"https://api.github.com/users/TooTallNate/gists{/gist_id}","starred_url":"https://api.github.com/users/TooTallNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TooTallNate/subscriptions","organizations_url":"https://api.github.com/users/TooTallNate/orgs","repos_url":"https://api.github.com/users/TooTallNate/repos","events_url":"https://api.github.com/users/TooTallNate/events{/privacy}","received_events_url":"https://api.github.com/users/TooTallNate/received_events","type":"User","site_admin":false},"body":"Sorry, I'm obviously not getting something here. What exactly is the implied change here from the switch to Uint8Array? As long as the C++ layer can still unwrap to the bare `char *` then I think it shouldn't really matter. The GC handled Buffers before as well so I'm not sure what the change here will be.\r\n\r\nAlso this has basically been the recommended way of allocating memory for structs/etc. in node-ffi for years now, so I would hate for that to be an issue :grinning: ","created_at":"2015-05-22T18:40:19Z","updated_at":"2015-05-22T18:40:19Z","html_url":"https://github.com/nodejs/io.js/pull/1762#discussion_r30920453","pull_request_url":"https://api.github.com/repos/nodejs/io.js/pulls/1762","_links":{"self":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/comments/30920453"},"html":{"href":"https://github.com/nodejs/io.js/pull/1762#discussion_r30920453"},"pull_request":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/1762"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/io.js/pulls/1762","id":36001660,"html_url":"https://github.com/nodejs/io.js/pull/1762","diff_url":"https://github.com/nodejs/io.js/pull/1762.diff","patch_url":"https://github.com/nodejs/io.js/pull/1762.patch","issue_url":"https://api.github.com/repos/nodejs/io.js/issues/1762","number":1762,"state":"open","locked":false,"title":"[Discussion] FFI - require('dlopen') - libuv dynamic library loader binding","user":{"login":"TooTallNate","id":71256,"avatar_url":"https://avatars.githubusercontent.com/u/71256?v=3","gravatar_id":"","url":"https://api.github.com/users/TooTallNate","html_url":"https://github.com/TooTallNate","followers_url":"https://api.github.com/users/TooTallNate/followers","following_url":"https://api.github.com/users/TooTallNate/following{/other_user}","gists_url":"https://api.github.com/users/TooTallNate/gists{/gist_id}","starred_url":"https://api.github.com/users/TooTallNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TooTallNate/subscriptions","organizations_url":"https://api.github.com/users/TooTallNate/orgs","repos_url":"https://api.github.com/users/TooTallNate/repos","events_url":"https://api.github.com/users/TooTallNate/events{/privacy}","received_events_url":"https://api.github.com/users/TooTallNate/received_events","type":"User","site_admin":false},"body":"This is a continuation of #1750 and #1759.\r\n\r\nThis PR adds a new public module: `require('dlopen')`. I'm the owner of the [current npm module](https://www.npmjs.com/package/dlopen), and I'm fine with relinquishing control of it in favor of allowing core to use the name (I'm open to alternative names as well).\r\n\r\nThe current impl is very close to a 1-1 mapping of the C uv_dlopen() and friends API, with very minimal JS wrapping to make the API more JS-friendly. We could also/instead do an object-oriented `Library` class API if there is consensus that that would be more node-like.\r\n\r\nBasic usage looks something like:\r\n\r\n``` js\r\nvar dl = require('dlopen');\r\n\r\nvar lib = dl.dlopen('libc.dylib');\r\n// lib is a Buffer instance, the `uv_lib_t *` struct\r\n\r\nvar printfPtr = dl.dlsym(lib, 'printf');\r\n// pass the printf function pointer to FFI, etc.\r\n\r\n// ... some time later... we're done with `lib`\r\ndl.dlclose(lib);\r\n```\r\n\r\nSimilar to the other PRs, this still needs docs and tests. Mostly just looking for preliminary feedback/comments while I get those in.","created_at":"2015-05-22T05:34:33Z","updated_at":"2015-05-22T18:40:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c27dc83a90c46e74ae1cb5c8247536f8f9747430","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/io.js/pulls/1762/commits","review_comments_url":"https://api.github.com/repos/nodejs/io.js/pulls/1762/comments","review_comment_url":"https://api.github.com/repos/nodejs/io.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/io.js/issues/1762/comments","statuses_url":"https://api.github.com/repos/nodejs/io.js/statuses/b7aaf11e818b0d40e05063e13b1e7f23e89cbc9b","head":{"label":"TooTallNate:idea/dlopen","ref":"idea/dlopen","sha":"b7aaf11e818b0d40e05063e13b1e7f23e89cbc9b","user":{"login":"TooTallNate","id":71256,"avatar_url":"https://avatars.githubusercontent.com/u/71256?v=3","gravatar_id":"","url":"https://api.github.com/users/TooTallNate","html_url":"https://github.com/TooTallNate","followers_url":"https://api.github.com/users/TooTallNate/followers","following_url":"https://api.github.com/users/TooTallNate/following{/other_user}","gists_url":"https://api.github.com/users/TooTallNate/gists{/gist_id}","starred_url":"https://api.github.com/users/TooTallNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TooTallNate/subscriptions","organizations_url":"https://api.github.com/users/TooTallNate/orgs","repos_url":"https://api.github.com/users/TooTallNate/repos","events_url":"https://api.github.com/users/TooTallNate/events{/privacy}","received_events_url":"https://api.github.com/users/TooTallNate/received_events","type":"User","site_admin":false},"repo":{"id":35912088,"name":"io.js","full_name":"TooTallNate/io.js","owner":{"login":"TooTallNate","id":71256,"avatar_url":"https://avatars.githubusercontent.com/u/71256?v=3","gravatar_id":"","url":"https://api.github.com/users/TooTallNate","html_url":"https://github.com/TooTallNate","followers_url":"https://api.github.com/users/TooTallNate/followers","following_url":"https://api.github.com/users/TooTallNate/following{/other_user}","gists_url":"https://api.github.com/users/TooTallNate/gists{/gist_id}","starred_url":"https://api.github.com/users/TooTallNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TooTallNate/subscriptions","organizations_url":"https://api.github.com/users/TooTallNate/orgs","repos_url":"https://api.github.com/users/TooTallNate/repos","events_url":"https://api.github.com/users/TooTallNate/events{/privacy}","received_events_url":"https://api.github.com/users/TooTallNate/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TooTallNate/io.js","description":"What should go in this box? https://github.com/nodejs/io.js/issues/1714","fork":true,"url":"https://api.github.com/repos/TooTallNate/io.js","forks_url":"https://api.github.com/repos/TooTallNate/io.js/forks","keys_url":"https://api.github.com/repos/TooTallNate/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TooTallNate/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TooTallNate/io.js/teams","hooks_url":"https://api.github.com/repos/TooTallNate/io.js/hooks","issue_events_url":"https://api.github.com/repos/TooTallNate/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/TooTallNate/io.js/events","assignees_url":"https://api.github.com/repos/TooTallNate/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/TooTallNate/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/TooTallNate/io.js/tags","blobs_url":"https://api.github.com/repos/TooTallNate/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TooTallNate/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TooTallNate/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/TooTallNate/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TooTallNate/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/TooTallNate/io.js/languages","stargazers_url":"https://api.github.com/repos/TooTallNate/io.js/stargazers","contributors_url":"https://api.github.com/repos/TooTallNate/io.js/contributors","subscribers_url":"https://api.github.com/repos/TooTallNate/io.js/subscribers","subscription_url":"https://api.github.com/repos/TooTallNate/io.js/subscription","commits_url":"https://api.github.com/repos/TooTallNate/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/TooTallNate/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/TooTallNate/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/TooTallNate/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/TooTallNate/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/TooTallNate/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TooTallNate/io.js/merges","archive_url":"https://api.github.com/repos/TooTallNate/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TooTallNate/io.js/downloads","issues_url":"https://api.github.com/repos/TooTallNate/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/TooTallNate/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/TooTallNate/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/TooTallNate/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TooTallNate/io.js/labels{/name}","releases_url":"https://api.github.com/repos/TooTallNate/io.js/releases{/id}","created_at":"2015-05-19T22:32:11Z","updated_at":"2015-05-19T22:32:15Z","pushed_at":"2015-05-22T18:27:12Z","git_url":"git://github.com/TooTallNate/io.js.git","ssh_url":"git@github.com:TooTallNate/io.js.git","clone_url":"https://github.com/TooTallNate/io.js.git","svn_url":"https://github.com/TooTallNate/io.js","homepage":"https://iojs.org","size":130760,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"nodejs:master","ref":"master","sha":"2b1c01c2cc203dd6131c3fc6238cf62a2e697f63","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"io.js","full_name":"nodejs/io.js","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/io.js","description":"What should go in this box? https://github.com/nodejs/io.js/issues/1714","fork":false,"url":"https://api.github.com/repos/nodejs/io.js","forks_url":"https://api.github.com/repos/nodejs/io.js/forks","keys_url":"https://api.github.com/repos/nodejs/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/io.js/teams","hooks_url":"https://api.github.com/repos/nodejs/io.js/hooks","issue_events_url":"https://api.github.com/repos/nodejs/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/io.js/events","assignees_url":"https://api.github.com/repos/nodejs/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/io.js/tags","blobs_url":"https://api.github.com/repos/nodejs/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/io.js/languages","stargazers_url":"https://api.github.com/repos/nodejs/io.js/stargazers","contributors_url":"https://api.github.com/repos/nodejs/io.js/contributors","subscribers_url":"https://api.github.com/repos/nodejs/io.js/subscribers","subscription_url":"https://api.github.com/repos/nodejs/io.js/subscription","commits_url":"https://api.github.com/repos/nodejs/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/io.js/merges","archive_url":"https://api.github.com/repos/nodejs/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/io.js/downloads","issues_url":"https://api.github.com/repos/nodejs/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/io.js/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/io.js/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-05-22T16:17:45Z","pushed_at":"2015-05-22T18:39:01Z","git_url":"git://github.com/nodejs/io.js.git","ssh_url":"git@github.com:nodejs/io.js.git","clone_url":"https://github.com/nodejs/io.js.git","svn_url":"https://github.com/nodejs/io.js","homepage":"https://iojs.org","size":182338,"stargazers_count":12489,"watchers_count":12489,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":928,"mirror_url":null,"open_issues_count":271,"forks":928,"open_issues":271,"watchers":12489,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/1762"},"html":{"href":"https://github.com/nodejs/io.js/pull/1762"},"issue":{"href":"https://api.github.com/repos/nodejs/io.js/issues/1762"},"comments":{"href":"https://api.github.com/repos/nodejs/io.js/issues/1762/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/1762/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/1762/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/io.js/statuses/b7aaf11e818b0d40e05063e13b1e7f23e89cbc9b"}}}}