~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to ext/probeprofiler/probeprofiler.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <ruby.h>
2
 
#include <yarvcore.h>
 
1
#include <ruby/ruby.h>
 
2
#include <vm_core.h>
 
3
 
 
4
VALUE rb_thread_current_status(rb_thread_t *);
 
5
void rb_add_event_hook(rb_event_hook_func_t, rb_event_flag_t, VALUE);
 
6
int rb_remove_event_hook(rb_event_hook_func_t);
3
7
 
4
8
static void
5
9
hash_inc(VALUE data, VALUE key)
6
10
{
7
11
    VALUE num = INT2FIX(0);
8
12
 
9
 
    if (num = rb_hash_aref(data, key)) {
 
13
    if (RTEST(num = rb_hash_aref(data, key))) {
10
14
        num = INT2FIX(FIX2INT(num) + 1);
11
15
    }
12
16
 
15
19
 
16
20
static void
17
21
pprof_hook(rb_event_flag_t flag, VALUE data,
18
 
           VALUE dmyid, VALUE dmyklass)
 
22
           VALUE self, ID dmyid, VALUE dmyklass)
19
23
{
20
24
    rb_thread_t *th = GET_THREAD();
21
25
    VALUE sig = rb_thread_current_status(th);
43
47
    return Qnil;
44
48
}
45
49
 
46
 
static int
47
 
hash_to_ary_i(VALUE key, VALUE value, VALUE ary)
48
 
{
49
 
    rb_ary_push(ary, rb_ary_new3(2, value, key));
50
 
    return ST_CONTINUE;
51
 
}
52
 
 
 
50
void
53
51
Init_probeprofiler(void)
54
52
{
55
53
    VALUE mPProf;