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
| VALUE | |
| rb_hash_aref(hash, key) | |
| VALUE hash, key; | |
| { | |
| VALUE val; | |
| if (!st_lookup(RHASH(hash)->tbl, key, &val)) { | |
| return rb_funcall(hash, id_default, 1, key); | |
| } | |
| return val; |
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
| void | |
| rb_include_module(klass, module) | |
| VALUE klass, module; | |
| { | |
| VALUE p, c; | |
| int changed = 0; | |
| rb_frozen_class_p(klass); | |
| if (!OBJ_TAINTED(klass)) { | |
| rb_secure(4); |
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
| Sampling process 3522 for 3 seconds with 1 millisecond of run time between samples | |
| Sampling completed, processing symbols... | |
| Analysis of sampling ruby (pid 3522) every 1 millisecond | |
| Call graph: | |
| 2185 Thread_2507 | |
| 2185 start | |
| 2185 main | |
| 2185 ruby_run_node | |
| 2185 ruby_exec_node | |
| 2185 rb_iseq_eval_main |
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
| require 'rubygems' | |
| require 'ffi' | |
| module Aio | |
| extend FFI::Library | |
| READ_CALLBACK = Proc.new do |sigval| | |
| req = sigval.sival_ptr | |
| if aio_error( req ) == 0 | |
| ret = aio_return( req ); |
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
| pid$target::st_lookup:entry { | |
| self->arg2 = arg2; | |
| printf("\nKey %d, value %d\n", arg1, *(uint32_t *)copyin(self->arg2, 4)); | |
| } |
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
| typedef unsigned long rb_value_t; | |
| typedef unsigned long rb_id_t; | |
| typedef unsigned long st_data_t; | |
| struct st_table_entry { | |
| unsigned int hash; | |
| st_data_t key; | |
| st_data_t record; | |
| caddr_t next; | |
| }; |
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
| #!/usr/sbin/dtrace -s | |
| #pragma D option quiet | |
| typedef struct st_table { | |
| struct st_hash_type *type; | |
| int num_bins; | |
| int num_entries; | |
| struct st_table_entry **bins; | |
| } st_table_t; |
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
| struct st_table { | |
| struct st_hash_type *type; | |
| int num_bins = 11; | |
| int num_entries = 1; | |
| struct st_table_entry **bins; | |
| }; | |
| struct st_table { | |
| struct st_hash_type *type; | |
| int num_bins = 283; | |
| int num_entries = 814; |
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
| strhash( setegid ) | |
| strhash( allocate ) | |
| numhash( 9697 ) | |
| strhash( setreuid ) | |
| strhash( setreuid ) | |
| numhash( 9705 ) | |
| strhash( initialize ) | |
| strhash( initialize_copy ) | |
| numhash( 9705 ) | |
| strhash( __attached__ ) |
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
| #ifdef HASH_LOG | |
| static int collision = 0; | |
| static int init_st = 0; | |
| static void | |
| stat_col() | |
| { | |
| FILE *f = fopen("/tmp/col", "w"); | |
| fprintf(f, "collision: %d\n", collision); | |
| fclose(f); |