Permalink
Browse files

docs: sooo mucchhhh

sleep time :)
  • Loading branch information...
1 parent 581c59c commit b08e147031418f7f1c1d51b6ef592300ff261f5a @TooTallNate committed Jul 5, 2012
Showing with 11 additions and 8 deletions.
  1. +11 −8 lib/ref.js
View
@@ -750,9 +750,10 @@ exports.writePointer = function writePointer (buf, offset, ptr) {
exports._reinterpret = exports.reinterpret
/**
- * Returns a new Buffer instance with the specified size.
+ * Returns a new Buffer instance with the specified _size_, with the same memory
+ * address as _buffer_.
*
- * This function "attaches" _buffer to the returned Buffer to prevent it from
+ * 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.
@@ -768,12 +769,9 @@ exports.reinterpret = function reinterpret (buffer, size) {
}
/**
- * Accepts a `Buffer` instance and a number of `NULL` bytes to read from the
- * pointer. This function will scan past the boundary of the Buffer's `length`
- * until it finds `size` number of aligned `NULL` bytes.
- *
- * This private version does not "attach" the original `Buffer` to the returned
- * `Buffer`, which could be potentially dangerous. Use with caution!
+ * Same as `ref.reinterpretUntilZeros()`, except that this version does not
+ * attach _buffer_ to the returned Buffer, which is potentially unsafe if the
+ * garbage collector runs.
*
* @api private
*/
@@ -793,6 +791,11 @@ exports._reinterpretUntilZeros = exports.reinterpretUntilZeros
* return ref.reinterpretUntilZeros(buf, 1).toString('utf8')
* }
* ```
+ *
+ * This function "attaches" _buffer_ to the returned Buffer to prevent it from
+ * being garbage collected.
+ *
+ * @return {Buffer} A new Buffer instance with the same memory address as _buffer_, and a variable `length` that is terminated by _size_ NUL bytes.
*/
exports.reinterpretUntilZeros = function reinterpretUntilZeros (buffer, size) {

0 comments on commit b08e147

Please sign in to comment.