GC Error: Bad Refs

BlitzMax Forums/BlitzMax Programming/GC Error: Bad Refs

N(Posted 2006) [#1]


Having trouble figuring out what's causing this even after going over the GC code. So, I present to you the code that produces the 'error.' No, it doesn't draw anything right now (and doesn't even if you add an image -- I borked it somehow, but that's irrelevant).

So, anyone have any ideas? Would be a good idea for BRL to step in and comment on this.


Perturbatio(Posted 2006) [#2]
Near as I can tell, it's the memcopy doing it.


Dreamora(Posted 2006) [#3]
Yepp definitely the memcopy.
It does not update the refcounter which is used by the GC to decide "whats unneeded" as it is no BM internal functionality but a C functionality to operate on external / C data.
You need to fully writeout your clone functionality to solve the ref count problem.


N(Posted 2006) [#4]
Oh yeah, copying four too many bytes. Thanks, guys.