This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static VALUE | |
| internal_read_func(void *ptr) | |
| { | |
| struct io_internal_struct *iis = (struct io_internal_struct*)ptr; | |
| return read(iis->fd, iis->buf, iis->capa); | |
| } | |
| static VALUE | |
| internal_write_func(void *ptr) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ruby.h" | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <errno.h> | |
| #include <signal.h> | |
| #include <fcntl.h> | |
| #ifdef _POSIX_ASYNCHRONOUS_IO | |
| #include <aio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static VALUE | |
| internal_read_func(void *ptr) | |
| { | |
| struct io_internal_struct *iis = (struct io_internal_struct*)ptr; | |
| return read(iis->fd, iis->buf, iis->capa); | |
| } | |
| static VALUE | |
| internal_write_func(void *ptr) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =begin | |
| macbook-pros-computer:~ lourens$ ruby gc.rb | |
| Collected 1112060 | |
| Collected 1112130 | |
| Collected 1112200 | |
| Collected 1112270 | |
| Collected 1112340 | |
| =end | |
| include ObjectSpace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Tests for AIO in librt. | |
| Copyright (C) 1998,2000,02 Free Software Foundation, Inc. | |
| This file is part of the GNU C Library. | |
| Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. | |
| The GNU C Library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public | |
| License as published by the Free Software Foundation; either | |
| version 2.1 of the License, or (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # = ostruct.rb: OpenStruct implementation | |
| # | |
| # Author:: Yukihiro Matsumoto | |
| # Documentation:: Gavin Sinclair | |
| # | |
| # OpenStruct allows the creation of data objects with arbitrary attributes. | |
| # See OpenStruct for an example. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macbook-pros-computer:callback lourens$ rake bench | |
| (in /Users/lourens/projects/callback) | |
| /opt/local/ruby19/lib/ruby/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:992: warning: Insecure world writable dir /Users/lourens in PATH, mode 040753 | |
| Rehearsal --------------------------------------------------------------------------------- | |
| Callback{ 'hai' }.call 0.010000 0.000000 0.010000 ( 0.018309) | |
| RubyCallback{ 'hai' }.call 0.030000 0.000000 0.030000 ( 0.025148) | |
| Callback( 'bai', :to_s ).call 0.000000 0.000000 0.000000 ( 0.007654) | |
| RubyCallback( 'bai', :to_s ).call 0.020000 0.000000 0.020000 ( 0.014259) | |
| Callback( 'bai', :gsub ).call( 'b', 'h' ) 0.040000 0.000000 0.040000 ( 0.041170) | |
| RubyCallback( 'bai', :gsub ).call( 'b', 'h' ) 0.060000 0.000000 0.060000 ( 0.061157) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macbook-pros-computer:callback lourens$ rake bench | |
| (in /Users/lourens/projects/callback) | |
| ruby bench/bench.rb | |
| warning: Insecure world writable dir /Users/lourens in PATH, mode 040753 | |
| Rehearsal --------------------------------------------------------------------------------- | |
| Callback{ 'hai' }.call 0.030000 0.000000 0.030000 ( 0.035305) | |
| RubyCallback{ 'hai' }.call 0.060000 0.000000 0.060000 ( 0.063904) | |
| Callback( 'bai', :to_s ).call 0.020000 0.000000 0.020000 ( 0.010352) | |
| RubyCallback( 'bai', :to_s ).call 0.030000 0.000000 0.030000 ( 0.035379) | |
| Callback( 'bai', :gsub ).call( 'b', 'h' ) 0.030000 0.000000 0.030000 ( 0.027821) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macbook-pros-computer:~ lourens$ ruby as_bench.rb | |
| Rehearsal ---------------------------------------------------------------------------- | |
| Hash#faster_diff 0.100000 0.000000 0.100000 ( 0.103662) | |
| Hash#diff 0.120000 0.000000 0.120000 ( 0.116199) | |
| Hash#faster_deep_merge 0.020000 0.000000 0.020000 ( 0.027282) | |
| Hash#deep_merge 0.030000 0.000000 0.030000 ( 0.032799) | |
| FasterHashWithIndifferentAccess#to_hash 0.020000 0.000000 0.020000 ( 0.025512) | |
| HashWithIndifferentAccess#to_hash 0.040000 0.000000 0.040000 ( 0.039692) | |
| Hash#faster_reverse_merge! 0.020000 0.000000 0.020000 ( 0.026483) | |
| Hash#reverse_merge! 0.060000 0.000000 0.060000 ( 0.053396) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macbook-pros-computer:~ lourens$ ruby as_bench.rb | |
| Rehearsal ---------------------------------------------------------------------------- | |
| Hash#faster_diff 0.100000 0.000000 0.100000 ( 0.103207) | |
| Hash#diff 0.120000 0.000000 0.120000 ( 0.118790) | |
| Hash#faster_deep_merge 0.030000 0.000000 0.030000 ( 0.027385) | |
| Hash#deep_merge 0.030000 0.000000 0.030000 ( 0.032819) | |
| FasterHashWithIndifferentAccess#to_hash 0.030000 0.000000 0.030000 ( 0.027202) | |
| HashWithIndifferentAccess#to_hash 0.030000 0.000000 0.030000 ( 0.032386) | |
| Hash#faster_reverse_merge! 0.030000 0.000000 0.030000 ( 0.032605) | |
| Hash#reverse_merge! 0.040000 0.000000 0.040000 ( 0.045057) |