malloc 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +1 -0
- data/Makefile +3 -3
- data/README +1 -0
- data/binary.gemspec +4 -4
- data/ext/error.hh +0 -15
- data/lib/malloc_ext.rb +14 -8
- data/source.gemspec +4 -4
- metadata +5 -4
data/.document
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lib/**/*.rb
|
data/Makefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
.SUFFIXES: .gem .o .cc .hh .rb .tar .gz .bz2
|
3
3
|
|
4
4
|
RUBY_VERSION = 1.8
|
5
|
-
MALLOC_VERSION = 0.2.
|
5
|
+
MALLOC_VERSION = 0.2.3
|
6
6
|
|
7
7
|
CP = cp
|
8
8
|
RM = rm -Rf
|
@@ -15,7 +15,7 @@ GIT = git
|
|
15
15
|
SITELIBDIR = $(shell $(RUBY) -r mkmf -e "puts \"\#{Config::CONFIG['sitelibdir']}\"")
|
16
16
|
SITEARCHDIR = $(shell $(RUBY) -r mkmf -e "puts \"\#{Config::CONFIG['sitearchdir']}\"")
|
17
17
|
|
18
|
-
MAIN = Makefile source.gemspec binary.gemspec README COPYING
|
18
|
+
MAIN = Makefile source.gemspec binary.gemspec README COPYING .document
|
19
19
|
EXT = ext/extconf.rb $(wildcard ext/*.cc) $(wildcard ext/*.hh)
|
20
20
|
LIB = $(wildcard lib/*.rb)
|
21
21
|
TEST = $(wildcard test/*.rb)
|
@@ -48,7 +48,7 @@ uninstall-gem::
|
|
48
48
|
$(GEM) uninstall malloc || echo Nothing to uninstall
|
49
49
|
|
50
50
|
yardoc:: README $(LIB)
|
51
|
-
$(YARDOC)
|
51
|
+
$(YARDOC) --no-private
|
52
52
|
|
53
53
|
check:: ext/malloc.so $(LIB) $(TEST)
|
54
54
|
$(RUBY) -rrubygems -Iext -Ilib -Itest test/ts_malloc.rb
|
data/README
CHANGED
@@ -1 +1,2 @@
|
|
1
1
|
This Ruby extension defines the class Hornetseye::Malloc. Hornetseye::Malloc#new allows you to allocate memory, using Hornetseye::Malloc#+ one can do pointer manipulation, and Hornetseye::Malloc#read and Hornetseye::Malloc#write provide reading Ruby strings from memory and writing Ruby strings to memory.
|
2
|
+
|
data/binary.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'date'
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = %q{malloc}
|
4
|
-
s.version = '0.2.
|
4
|
+
s.version = '0.2.3'
|
5
5
|
s.platform = Gem::Platform::CURRENT
|
6
6
|
s.date = Date.today.to_s
|
7
7
|
s.summary = %q{Object for raw memory allocation and pointer operations}
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.author = %q{Jan Wedekind}
|
10
10
|
s.email = %q{jan@wedesoft.de}
|
11
11
|
s.homepage = %q{http://wedesoft.github.com/malloc/}
|
12
|
-
s.files = [ 'README', 'COPYING' ] +
|
12
|
+
s.files = [ 'README', 'COPYING', '.document' ] +
|
13
13
|
Dir.glob( 'lib/*.rb' ) +
|
14
14
|
[ 'ext/malloc.so' ] +
|
15
15
|
Dir.glob( 'test/*.rb' )
|
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = [ 'lib', 'ext' ]
|
18
18
|
s.rubyforge_project = %q{hornetseye}
|
19
19
|
s.has_rdoc = 'yard'
|
20
|
-
|
21
|
-
|
20
|
+
s.extra_rdoc_files = []
|
21
|
+
s.rdoc_options = %w{--no-private}
|
22
22
|
end
|
data/ext/error.hh
CHANGED
@@ -11,21 +11,6 @@
|
|
11
11
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
12
|
GNU General Public License for more details.
|
13
13
|
|
14
|
-
You should have received a copy of the GNU General Public License
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
16
|
-
/* HornetsEye - Computer Vision with Ruby
|
17
|
-
Copyright (C) 2006, 2007 Jan Wedekind
|
18
|
-
|
19
|
-
This program is free software: you can redistribute it and/or modify
|
20
|
-
it under the terms of the GNU General Public License as published by
|
21
|
-
the Free Software Foundation, either version 3 of the License, or
|
22
|
-
(at your option) any later version.
|
23
|
-
|
24
|
-
This program is distributed in the hope that it will be useful,
|
25
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
26
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
27
|
-
GNU General Public License for more details.
|
28
|
-
|
29
14
|
You should have received a copy of the GNU General Public License
|
30
15
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
31
16
|
#ifndef ERROR_HH
|
data/lib/malloc_ext.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Namespace of the Hornetseye project.
|
2
2
|
module Hornetseye
|
3
3
|
|
4
|
-
# Class for allocating raw memory and for doing pointer operations
|
4
|
+
# Class for allocating raw memory and for doing pointer operations
|
5
5
|
class Malloc
|
6
6
|
|
7
7
|
class << self
|
8
8
|
|
9
|
-
# Create new Malloc object
|
9
|
+
# Create new Malloc object
|
10
10
|
#
|
11
11
|
# @param [size] Number of bytes to allocate.
|
12
12
|
# @return [Malloc] A new Malloc object.
|
@@ -20,10 +20,12 @@ module Hornetseye
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
-
# Number of bytes allocated
|
23
|
+
# Number of bytes allocated
|
24
|
+
#
|
25
|
+
# @return [Integer] Size of allocated memory.
|
24
26
|
attr_reader :size
|
25
27
|
|
26
|
-
# Operator for doing pointer arithmetic
|
28
|
+
# Operator for doing pointer arithmetic
|
27
29
|
#
|
28
30
|
# @param [offset] Non-negative offset for pointer.
|
29
31
|
# @return [Malloc] A new Malloc object.
|
@@ -39,7 +41,7 @@ module Hornetseye
|
|
39
41
|
|
40
42
|
private :orig_plus
|
41
43
|
|
42
|
-
# Read data from memory
|
44
|
+
# Read data from memory
|
43
45
|
#
|
44
46
|
# @param [length] Number of bytes to read.
|
45
47
|
# @return [String] A string containing the data.
|
@@ -51,7 +53,7 @@ module Hornetseye
|
|
51
53
|
|
52
54
|
private :orig_read
|
53
55
|
|
54
|
-
# Write data to memory
|
56
|
+
# Write data to memory
|
55
57
|
#
|
56
58
|
# @param [string] A string with the data.
|
57
59
|
# @return [String] Returns the parameter `string`.
|
@@ -69,14 +71,18 @@ module Hornetseye
|
|
69
71
|
|
70
72
|
end
|
71
73
|
|
72
|
-
# The string class of the standard library
|
74
|
+
# The string class of the standard library
|
75
|
+
#
|
76
|
+
# @private
|
73
77
|
class String
|
74
78
|
|
75
79
|
unless method_defined? :bytesize
|
76
80
|
|
77
|
-
# This method won't be overriden if it is defined already
|
81
|
+
# This method won't be overriden if it is defined already
|
78
82
|
#
|
79
83
|
# Provided for compatibility with Ruby 1.8.6. Same as #size.
|
84
|
+
#
|
85
|
+
# @private
|
80
86
|
def bytesize
|
81
87
|
size
|
82
88
|
end
|
data/source.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'date'
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = %q{malloc}
|
4
|
-
s.version = '0.2.
|
4
|
+
s.version = '0.2.3'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.date = Date.today.to_s
|
7
7
|
s.summary = %q{Object for raw memory allocation and pointer operations}
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = %q{jan@wedesoft.de}
|
11
11
|
s.homepage = %q{http://wedesoft.github.com/malloc/}
|
12
12
|
s.files = [ 'source.gemspec', 'binary.gemspec', 'Makefile', 'README',
|
13
|
-
'COPYING' ] +
|
13
|
+
'COPYING', '.document' ] +
|
14
14
|
Dir.glob( 'lib/*.rb' ) +
|
15
15
|
Dir.glob( 'ext/*.cc' ) +
|
16
16
|
Dir.glob( 'ext/*.hh' ) +
|
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.rubyforge_project = %q{hornetseye}
|
24
24
|
s.extensions = %w{ext/extconf.rb}
|
25
25
|
s.has_rdoc = 'yard'
|
26
|
-
|
27
|
-
|
26
|
+
s.extra_rdoc_files = []
|
27
|
+
s.rdoc_options = %w{--no-private}
|
28
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: malloc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Wedekind
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-11 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- Makefile
|
28
28
|
- README
|
29
29
|
- COPYING
|
30
|
+
- .document
|
30
31
|
- lib/malloc_ext.rb
|
31
32
|
- ext/error.cc
|
32
33
|
- ext/malloc.cc
|
@@ -41,8 +42,8 @@ homepage: http://wedesoft.github.com/malloc/
|
|
41
42
|
licenses: []
|
42
43
|
|
43
44
|
post_install_message:
|
44
|
-
rdoc_options:
|
45
|
-
|
45
|
+
rdoc_options:
|
46
|
+
- --no-private
|
46
47
|
require_paths:
|
47
48
|
- lib
|
48
49
|
- ext
|