diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-01 01:46:27 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-01 01:46:27 +0000 |
commit | 7030430fcbf5730dd1b661b1a49228cfca805dc9 (patch) | |
tree | 783639ffe9661183276c8dc50c8135c5a03e8805 /ext | |
parent | b164e6adb40198566f9aeaa7a059468274c5074e (diff) | |
download | ruby-7030430fcbf5730dd1b661b1a49228cfca805dc9.tar.gz ruby-7030430fcbf5730dd1b661b1a49228cfca805dc9.tar.xz ruby-7030430fcbf5730dd1b661b1a49228cfca805dc9.zip |
* test/dl/test_dl2.rb (**) testing malloc and realloc
* ext/dl/dl.c (**) adding documentation
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25605 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 6bef7bb32..beaed8439 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) { |