Skip to content

Commit

Permalink
Working on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wedesoft committed Nov 17, 2010
1 parent 7fe7b38 commit c7b1e72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -25,5 +25,15 @@ Alternatively you can build and install the Ruby extension from source as follow
Usage
-----

Simply run Interactive Ruby:

$ irb

You can load the Ruby extension like this:

require 'rubygems'
require 'malloc'
include Hornetseye

See documentation of {Hornetseye::Malloc} on how to use this Ruby extension.

18 changes: 2 additions & 16 deletions lib/malloc_ext.rb
Expand Up @@ -45,8 +45,6 @@ class << self
# Allocate the specified number of bytes of raw memory.
#
# @example Allocate raw memory
# require 'malloc'
# include Hornetseye
# m = Malloc.new 32
# # Malloc(32)
#
Expand All @@ -67,8 +65,6 @@ def new( size )
# Number of bytes allocated
#
# @example Querying size of allocated memory
# require 'malloc'
# include Hornetseye
# m = Malloc.new 32
# m.size
# # 32
Expand All @@ -81,8 +77,7 @@ def new( size )
# Display information about this object
#
# @example Displaying information about a Malloc object
# require 'malloc'
# Hornetseye::Malloc.new( 8 ).inspect
# Malloc.new( 8 ).inspect
# "Malloc(8)"
#
# @return [String] A string with information about this object.
Expand Down Expand Up @@ -110,8 +105,7 @@ def dup
# Display information about this object
#
# @example Displaying information about a Malloc object
# require 'malloc'
# Hornetseye::Malloc.new( 8 ).to_s
# Malloc.new( 8 ).to_s
# "Malloc(8)"
#
# @return [String] A string with information about this object.
Expand All @@ -122,8 +116,6 @@ def to_s
# Operator for doing pointer arithmetic
#
# @example Pointer arithmetic
# require 'malloc'
# include Hornetseye
# m = Malloc.new 4
# # Malloc(4)
# m.write 'abcd'
Expand All @@ -149,8 +141,6 @@ def +( offset )
# Read data from memory
#
# @example Reading and writing data
# require 'malloc'
# include Hornetseye
# m = Malloc.new 4
# # Malloc(4)
# m.write 'abcd'
Expand All @@ -173,8 +163,6 @@ def read( length )
# Write data to memory
#
# @example Reading and writing data
# require 'malloc'
# include Hornetseye
# m = Malloc.new 4
# # Malloc(4)
# m.write 'abcd'
Expand Down Expand Up @@ -208,8 +196,6 @@ def write( data )
# Shortcut for instantiating Malloc object
#
# @example Create malloc object
# require 'malloc'
# include Hornetseye
# m = Malloc 4
# # Malloc(4)
#
Expand Down

0 comments on commit c7b1e72

Please sign in to comment.