Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can a devious C programmer break the collector?

0
Posted

Can a devious C programmer break the collector?

0

Certainly, but most people have better ways to spend their time than dreaming up ways to break their tools. The collector does rely on being able to locate copies of pointers somewhere in an address space, so certain things won’t work. For instance, the XOR’d pointers trick for compactly encoding a bidirectional list cannot be used — the pointers don’t look like pointers. If a process writes pointers to a file, and reads them back again, the memory referenced by those pointers may have been recycled. Most programs don’t do these things, so most programs work with a garbage collector. Ordinary (legal) pointer arithmetic is tolerated by garbage collectors for C. One problem described by a team considering the use of GC is the use of pointer mangling to get “really opaque” pointers. That is, pointers handed out from a package to a client are XORed with a random number chosen at program start time, and thus the client cannot access package data structures without going through defined int

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123