Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trace String and Array allocations.
Browse files Browse the repository at this point in the history
Yorick Peterse committed Nov 6, 2014
1 parent f99c365 commit b92254d
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vm/builtin/array.cpp
Original file line number Diff line number Diff line change
@@ -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
@@ -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;
}

6 changes: 6 additions & 0 deletions vm/builtin/string.cpp
Original file line number Diff line number Diff line change
@@ -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>
@@ -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;
}

0 comments on commit b92254d

Please sign in to comment.