Comments (4)
All right, maybe gc think the 'aaa' variable is still using in stack. If I put allocation in a independent function, everything is fine.
from bdwgc.
See that ESP+4 to ESP+12 stores the address unexpectedly. And here is the asm of gc_cleanup::gc_cleanup() in Debug mode.
from bdwgc.
My feeling is that this is a judgment call. If there is an easy way to
clean more dead registers or stack locations at minimal cost, then it may
be worth doing. But a conservative collector is never going to guarantee
that "all dead objects" will be collected. Even for a non-conservative GC,
that's a tough notion to define, and Java doesn't try. No code should be
relying on running a finalizer at a certain point.
In this particular case, it's not clear to me there is a cheap/easy
solution. Especially if this only happens in debug mode.
I would generally be more concerned with stack locations that may not be
overwritten for a long time than with registers that might keep an object
live for a single GC.
On Mon, Jan 4, 2016 at 7:32 AM, taigacon [email protected] wrote:
All right, EAX and ECX still hold the address of the latest allocated
object ( in Debug mode ). Shall we clear all the registers before we call
GC_gccollect() ?β
Reply to this email directly or view it on GitHub
#85 (comment).
from bdwgc.
@hboehm writes:
Even for a non-conservative GC, that's a tough notion to define
Indeed. See http://www.memorymanagement.org/glossary/d.html#term-dead
It is not possible, in general, for garbage collectors to determine exactly which objects are dead and which are live. Instead, they use some approximation to detect objects that are provably dead, such as those that are unreachable.
And also http://www.ravenbrook.com/project/mps/master/manual/html/topic/finalization.html#cautions
Donβt rely on finalization for your program to work. Treat it as an optimization that enables the freeing of resources that the garbage collector can prove are unreachable.
This is a message I've been repeating for many years :)
from bdwgc.
Related Issues (20)
- Downstream libgc releases (Feb 2024) HOT 21
- GC hangs with "parallel mark" if using `GC_allow_register_threads()` HOT 11
- Debugging an issue with GC seemingly not happening on Emscripten/WebAssembly
- Upstream TLS support HOT 2
- How final are the finalizers? HOT 2
- Problem getting finalizers to work HOT 3
- Add examples collection of small programs showing how to use GC for varioues features and with different configurations HOT 2
- Support CHERI extension HOT 3
- using extra pointer bits on x86_64 (tagged pointer support) HOT 3
- Resolve warnings reported by cppcheck 2.13.3
- rare case of infinite loop on Android HOT 9
- gctest hang on msys64 if mprotected-based incremental collection is on HOT 9
- zig-msvc target error: 'unistd.h' file not found HOT 18
- Specify soversion for shared libs built by Zig
- Unexpected heap growth in gctest if no parallel marker
- cordtest hang on Windows if shared build by Zig using msvc HOT 7
- Some Windows gnu builds hang in zig build
- gctest hang sometimes on Windows if compiled with threads discovery
- Redirect malloc_usable_size() in leak_detector.h HOT 6
- Compilation with TCC fails on ARM macs HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bdwgc.