|
|
|
|
|
by davidsiems
5235 days ago
|
|
I think the 'best' trick I've seen is using pointer tagging on an object's virtual function table pointer to squeeze in an extra flag during garbage collection. Adding another variable was thrashing the cache, so instead the GC would tag the VFT pointer (making it unusable obviously) and then untag it before GC ended, fixing the object. I wasn't sure if I should be horrified or applaud when I found out about this. |
|
So I wrote some code that constructed a new object of the same type on the stack, then
It worked. I'm not proud of it, but I am amused by it. I'm sure it wasn't guaranteed to work by any standard, but in practice worked fine for us.