diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-30 12:54:41 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-30 12:54:41 +0000 |
commit | 3cce74dc4c4abfb6840de4ba9bcea4df2f502b15 (patch) | |
tree | ebfdb2480bfc27503496706ff17f853509c01e13 /ext | |
parent | 0777c729cd1ae095ce18b55fb1cdf20b0d34cb0d (diff) |
merges r25605 from trunk into ruby_1_9_1.
--
* test/dl/test_dl2.rb (**) testing malloc and realloc
* ext/dl/dl.c (**) adding documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dl/dl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c index 7a21fa9d25..39ffc5a1fa 100644 --- a/ext/dl/dl.c +++ b/ext/dl/dl.c @@ -16,6 +16,12 @@ rb_dl_dlopen(int argc, VALUE argv[], VALUE self) return rb_class_new_instance(argc, argv, rb_cDLHandle); } +/* + * call-seq: DL.malloc + * + * Allocate +size+ bytes of memory and return the integer memory address + * for the allocated memory. + */ VALUE rb_dl_malloc(VALUE self, VALUE size) { @@ -26,6 +32,13 @@ rb_dl_malloc(VALUE self, VALUE size) return PTR2NUM(ptr); } +/* + * call-seq: DL.realloc(addr, size) + * + * Change the size of the memory allocated at the memory location +addr+ to + * +size+ bytes. Returns the memory address of the reallocated memory, which + * may be different than the address passed in. + */ VALUE rb_dl_realloc(VALUE self, VALUE addr, VALUE size) { |