I was wondering if anyone has written D code to access the x86
performance counters, to get information such as the number of
cache misses and cycle count.
Unfortunately I don't have any good suggestions... I have been
avoiding
depending on dtors in D because of the aforementioned issues
(and more),
so I haven't had much experience in debugging dtor-related
problems in
D.
I decided to just free everything explicitly:
https://github.com/maximecb
I posted a thread the other day explaining that I was running
into a memory leak issue which is very hard to debug. There seems
to be a false pointer somewhere, and I have no way of knowing
where that is or which object is being pointed to. I decided to
take the easy way out and explicitly free
GC problems are *nasty*. My advice is to run the simplest
program you can think of that still exhibits the problem, and
then put in printf debugging everywhere to see where it breaks
down.
Not sure if this is useful.
Unfortunately, the program doesn't break or crash. It just keeps
allocatin
There seems to be a memory leak in the Higgs compiler. This
problem shows up when running our test suite (`make test`
command).
A new VM object is created for each unittest block, e.g.:
https://github.com/maximecb/Higgs/blob/master/source/runtime/tests.d#L201
These VM objects are unfortunately
I have a situation where I have a VM (virtual machine) object,
and several GCRoot (garbage collector root objects). The GCRoots
are structs and will "register" themselves into a linked list
belonging to the VM. I've made it so they unregister themselves
in their destructor. This works perfectly
In my JavaScript VM, I have a function whose purpose is to expose
D/host constants to the JavaScript runtime code running inside
the VM. This makes for somewhat redundant code, as follows:
vm.defRTConst("OBJ_MIN_CAP"w, OBJ_MIN_CAP);
vm.defRTConst("PROTO_SLOT_IDX"w, PROTO_SLOT_IDX);
vm.defRTCons
I got the following code to do what I want:
static this()
{
void addOp(ref Opcode op)
{
assert (
op.mnem !in iir,
"duplicate op name " ~ op.mnem
);
iir[op.mnem] = &op;
}
foreach (memberName; __traits(allMembers, ir.ops))
{
On Wednesday, 9 July 2014 at 20:07:57 UTC, NCrashed wrote:
On Wednesday, 9 July 2014 at 20:04:47 UTC, Maxime
Chevalier-Boisvert wrote:
auto members = [__traits(allMembers, "ir.ir")];
pragma(msg, members);
Have you tried without quotes?
pragma(msg, __traits(allMembers, ir.ir));
Did need to wr
Hello,
I'm looking to introspect a module, list all the members, iterate
over them and filter them by kind inside of a static constructor.
This is in the hope of shortening some hand-written code that is
quite repetitive (adding many struct instances to an associative
array in a static constr
10 matches
Mail list logo