Skip to content
Browse files

docs: moar

  • Loading branch information...
1 parent 7e8fbcc commit 581c59c424ba38073c09672c727d17d252e6e947 @TooTallNate committed Jul 5, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/ref.js
View
14 lib/ref.js
@@ -724,6 +724,10 @@ exports._writePointer = exports.writePointer
* var buf = ref.alloc('pointer');
* ref.writePointer(buf, 0, someBuffer);
* ```
+ *
+ * @param {Buffer} buffer A Buffer instance to write _pointer to.
+ * @param {Number} offset The offset on the Buffer to start writing at.
+ * @param {Buffer} pointer The Buffer instance whose memory address will be written to _buffer_.
*/
exports.writePointer = function writePointer (buf, offset, ptr) {
@@ -737,13 +741,23 @@ exports.writePointer = function writePointer (buf, offset, ptr) {
* _buffer_ to the returned Buffer, which is potentially unsafe if the
* garbage collector runs.
*
+ * @param {Buffer} buffer A Buffer instance to base the returned Buffer off of.
+ * @param {Number} size The `length` property of the returned Buffer.
+ * @return {Buffer} A new Buffer instance with the same memory address as _buffer_, and the requested _size_.
* @api private
*/
exports._reinterpret = exports.reinterpret
/**
* Returns a new Buffer instance with the specified size.
+ *
+ * This function "attaches" _buffer to the returned Buffer to prevent it from
+ * being garbage collected.
+ *
+ * @param {Buffer} buffer A Buffer instance to base the returned Buffer off of.
+ * @param {Number} size The `length` property of the returned Buffer.
+ * @return {Buffer} A new Buffer instance with the same memory address as _buffer_, and the requested _size_.
*/
exports.reinterpret = function reinterpret (buffer, size) {

0 comments on commit 581c59c

Please sign in to comment.
Something went wrong with that request. Please try again.