From 5668758c2ddfa2316bb9bdc8d45a0f73b9e0a11f Mon Sep 17 00:00:00 2001 From: Jan Wedekind Date: Wed, 17 Nov 2010 00:18:13 +0000 Subject: [PATCH] Added some documentation --- Rakefile | 2 +- lib/malloc_ext.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index b1833eb..cbf83f5 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ require 'rake/loaders/makefile' require 'rbconfig' PKG_NAME = 'malloc' -PKG_VERSION = '1.3.4' +PKG_VERSION = '1.3.5' CFG = RbConfig::CONFIG CXX = ENV[ 'CXX' ] || 'g++' RB_FILES = FileList[ 'lib/**/*.rb' ] diff --git a/lib/malloc_ext.rb b/lib/malloc_ext.rb index 224e07e..79348e4 100644 --- a/lib/malloc_ext.rb +++ b/lib/malloc_ext.rb @@ -92,6 +92,14 @@ def inspect # Duplicate object # + # @example Duplicating a Malloc object + # m = Malloc.new 3 + # m.write 'aaa' + # n = m.dup + # n.write 'bbb' + # m.read 3 + # "aaa" + # # @return [Malloc] A new malloc object with a copy of the data. def dup retval = Malloc.new @size