Skip to content

Commit

Permalink
Trace String and Array allocations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorick Peterse committed Nov 6, 2014
1 parent f99c365 commit b92254d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vm/builtin/array.cpp
Expand Up @@ -9,6 +9,9 @@
#include "object_utils.hpp"
#include "ontology.hpp"

#include "call_frame.hpp"
#include "dtrace/dtrace.h"

/* Implementation certain Array methods. These methods are just
* the ones the VM requires, not the entire set of all Array methods.
* This includes methods required to implement certain Array
Expand Down Expand Up @@ -52,6 +55,9 @@ namespace rubinius {
Array* Array::allocate(STATE, Object* self) {
Array* ary = Array::create(state, 0);
ary->klass(state, as<Class>(self));

RUBINIUS_OBJECT_ALLOCATE_HOOK(state, ary, state->vm()->saved_call_frame())

return ary;
}

Expand Down
6 changes: 6 additions & 0 deletions vm/builtin/string.cpp
Expand Up @@ -27,6 +27,9 @@
#include "util/random.h"
#include "missing/string.h"

#include "call_frame.hpp"
#include "dtrace/dtrace.h"

#include <unistd.h>
#include <string.h>
#include <ctype.h>
Expand Down Expand Up @@ -61,6 +64,9 @@ namespace rubinius {
String* String::allocate(STATE, Object* self) {
String* str = state->new_object<String>(G(string));
str->klass(state, as<Class>(self));

RUBINIUS_OBJECT_ALLOCATE_HOOK(state, str, state->vm()->saved_call_frame());

return str;
}

Expand Down

0 comments on commit b92254d

Please sign in to comment.