Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
547 additions
and
194 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "builtin/class.hpp" | ||
#include "builtin/diagnostics.hpp" | ||
#include "builtin/lookup_table.hpp" | ||
|
||
namespace rubinius { | ||
void Diagnostics::init(STATE) { | ||
Module* diagnostics = state->new_object<Diagnostics>(G(module)); | ||
diagnostics->setup(state, "Diagnostics", G(rubinius)); | ||
|
||
diagnostics->set_const(state, "Map", LookupTable::create(state)); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef RBX_BUILTIN_DIAGNOSTICS_HPP | ||
#define RBX_BUILTIN_DIAGNOSTICS_HPP | ||
|
||
#include "builtin/class.hpp" | ||
#include "builtin/module.hpp" | ||
#include "builtin/object.hpp" | ||
|
||
#include "object_utils.hpp" | ||
#include "diagnostics.hpp" | ||
|
||
namespace rubinius { | ||
class LookupTable; | ||
|
||
class Diagnostics : public Module { | ||
public: | ||
const static object_type type = DiagnosticsType; | ||
|
||
private: | ||
LookupTable* map_; // slot | ||
|
||
public: | ||
attr_accessor(map, LookupTable); | ||
|
||
public: | ||
static void init(STATE); | ||
|
||
|
||
class Info : public Module::Info { | ||
public: | ||
BASIC_TYPEINFO(Module::Info) | ||
}; | ||
}; | ||
} | ||
|
||
#endif |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#ifndef RBX_DIAGNOSTICS_HPP | ||
#define RBX_DIAGNOSTICS_HPP | ||
|
||
#include <stdint.h> | ||
|
||
namespace rubinius { | ||
namespace diagnostics { | ||
class Diagnostics { | ||
bool modified_; | ||
|
||
public: | ||
Diagnostics() : modified_(false) { } | ||
virtual ~Diagnostics() { } | ||
|
||
virtual void log() { | ||
modified_ = false; | ||
} | ||
|
||
bool modified_p() { | ||
return modified_; | ||
} | ||
|
||
void modify() { | ||
modified_ = true; | ||
} | ||
}; | ||
|
||
class MemoryDiagnostics : public Diagnostics { | ||
public: | ||
int64_t objects_; | ||
int64_t bytes_; | ||
|
||
MemoryDiagnostics() | ||
: Diagnostics() | ||
, objects_(0) | ||
, bytes_(0) | ||
{ } | ||
}; | ||
} | ||
} | ||
|
||
#endif |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.