This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
My reaction:I was getting 'Abort's, and thought there might have been problems with the memory allocation code - there was a lot of debug statements around all the *allocs etc. I figured that if I could use the GC for memory allocation, it might be more stable. In the end, it turned out that the Abort's were being caused by more than one thread accessing the video hardware - at different times, but this still caused problems...
1) I'd be inclined to either write portable JNI code or stick to CNI.
2) Sticking pointers into jints is not recommended. On 64-bit machines they don't fit.Agreed - I had thought of replacing them all with jlong's, but that just defers the problem :-)
I don't really follow what you said there...3) I'm not sure what the best way is to allocate collectable untraced memory from CNI. You want something like _Jv_AllocBytes, which you presumably shouldn't use. The collector call is GC_MALLOC_ATOMIC, which you probably shouldn't use directly either. JvNewByteArray does a bunch of extra work. Tom?
4) The collector should handle the interior pointer into the array object correctly, but only if the pointer is in an automatic (stack) variable. That makes this a bit brittle for my taste. _Jv_AllocBytes wouldn't have this problem.
ATB, Simon
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |