![]() |
Re: Meego vs Android apps (C or Java?)
Quote:
But I am really replying just to share this quote here with you guys: Quote:
|
Re: Meego vs Android apps (C or Java?)
Quote:
And when you do, optimizing the code gets harder (for the more interesting cases than just slipping a pointer to a native library call). If you stay away from such endeavours, C# is not offering any pointers for the programmer to use. With the usual AFAIK disclaimer. ;) |
Re: Meego vs Android apps (C or Java?)
Quote:
So, no. When judging languages leave the memory fragmentation out of the conversation and surely don't compare the memory handling of Java with the memory handling of Firefox. I'm 100% sure that the Llinux kernel can do much better than JVM since it has actual view of the physical ram and the actual page allocation. |
Re: Meego vs Android apps (C or Java?)
This whole thread is moot now.
Should you change topic to "WP7 vs Android apps (C# or Java?)" When I have time, I try to prove that slowing down of my Firefox is due to heap memory fragmentation. No *malloc can remove fragmentation totally, because alive objects cannot be moved in the heap if pointers are allowed in the code (C/C++). I could point to some studies done for GC+memory management, but you guys can find them yourselves also with google. And yes, Java also kind of still have pointers, via JNI kinda, but as with C#, optimizations go down the drain then on that basic block of the code where the pointers are used. |
Re: Meego vs Android apps (C or Java?)
Quote:
Quote:
Quote:
Quote:
|
Re: Meego vs Android apps (C or Java?)
Quote:
Code:
Foo* foo = new Foo();Code:
unsafe { |
Re: Meego vs Android apps (C or Java?)
Yes, I understand that, but IMO that's more syntactic sugar/policy question than a technical differentiation. The choice is still yours, it's just that you have less 'are you sure' dialogs :)
|
Re: Meego vs Android apps (C or Java?)
Quote:
By declaring an unsafe context/scope you bypass the strict typing checks (not totally, but almost) and if you use fixed pointers you bypass the GC, not letting it move the pointed at memory. This isn't sugar in any way, shape or form. This is affecting the compiler and the runtime behaviour. Quote:
C# offers pointers, but not in the same way as C++, or C. If you use them, you're letting go of some fundamental features of the language along the way. |
Re: Meego vs Android apps (C or Java?)
Sorry to drag this conversation from the depths, but..
Wouldn't it be possible to create a object/class that emulates pointer memory modification in a safe way? It could potentially use the array primitive as the heap object to avoid the costly method call per pointer op and provide the mechanisms to do basic [pointer] arithmetic. It could also contain handy functionality to automatically re-size the object as memory needs increase/decrease to more closely emulate C's malloc. Since all objects are passed as references in method calls, this could give different aspects of an application access to the same structures in a safe way -- and very little computational penalty. Also data structures would be totally isolated from one another, which is a definite plus. While I appreciate that for a great many cases, objects and references are a fine substitute for the pointer, I also recognize that more exotic structures can use pointers to great effect. Perhaps this is a way to do it in the modern VM space. |
Re: Meego vs Android apps (C or Java?)
Quote:
Quote:
Which brings things us to the (repeated) bottom line - C++ as such does not *require* a certain type of memory management, it's not part of the language, so if you have a fancier, smarter way of dealing with allocated memory, give it a go. |
| All times are GMT. The time now is 16:06. |
vBulletin® Version 3.8.8