Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: fix few smalloc entries for proper formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
trevnorris committed Nov 13, 2013
1 parent c414ec1 commit 26a795b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions doc/api/smalloc.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

Stability: 1 - Experimental

`Smalloc` is a light weight API that allows developers to attach external data
to arbitrary `Object`s.

## smalloc.alloc(length[, receiver][, type])

* `length` {Number} `<= kMaxLength` (maximum allowed Buffer size by v8)
* `receiver` {Object} Optional, Default: `new Object()`
* `type` {Enum} Optional, Default: `Uint8`
* `length` {Number} `<= smalloc.kMaxLength`
* `receiver` {Object}, Optional, Default: `new Object`
* `type` {Enum}, Optional, Default: `Uint8`

Returns `receiver` with allocated external array data. If no `receiver` is
passed then a new Object will be created and returned.
Expand Down Expand Up @@ -49,13 +46,13 @@ possible options are listed in `smalloc.Types`. Example usage:

// { '0': 0, '1': 0.1, '2': 0.2 }

## smalloc.copyOnto(source, sourceStart, dest, destStart, copyLength)
## smalloc.copyOnto(source, sourceStart, dest, destStart, copyLength);

* `source` {Object} with external array allocation
* `sourceStart` {Position} to begin copying from
* `dest` {Object} with external array allocation
* `destStart` {Position} to begin copying onto
* `copyLength` {Length} of copy
* `source` Object with external array allocation
* `sourceStart` Position to begin copying from
* `dest` Object with external array allocation
* `destStart` Position to begin copying onto
* `copyLength` Length of copy

Copy memory from one external array allocation to another. No arguments are
optional, and any violation will throw.
Expand All @@ -80,7 +77,7 @@ need to set any additional properties for this to work.

## smalloc.dispose(obj)

* `obj` {Object}
* `obj` Object

Free memory that has been allocated to an object via `smalloc.alloc`.

Expand Down

0 comments on commit 26a795b

Please sign in to comment.