Dogen
Junior Member
Posts: 98
|
C++0x
Nov 1, 2008 22:15:58 GMT
Post by Dogen on Nov 1, 2008 22:15:58 GMT
I'm not seen the <new> library before. The only way I was away of allocating memory similar to that was using malloc().
|
|
|
C++0x
Nov 1, 2008 22:19:59 GMT
Post by Avtar on Nov 1, 2008 22:19:59 GMT
I'm not seen the <new> library before. The only way I was away of allocating memory similar to that was using malloc(). Ah yeah, that even I used while working with files in C++. Was quite an elementary use of the thing too, never went in depth. But yeah, I see your point.
I believe new() is the Java equivalent to malloc() in C++. Believed to be faster as well.
|
|
Dogen
Junior Member
Posts: 98
|
C++0x
Nov 1, 2008 22:27:28 GMT
Post by Dogen on Nov 1, 2008 22:27:28 GMT
Do you know where the documentation for new() in java is? Can't seam to find it in the API Documentation, that or Google is failing me.
|
|
|
C++0x
Nov 1, 2008 22:33:21 GMT
Post by Avtar on Nov 1, 2008 22:33:21 GMT
I found something for you here.
Check the paragraph starting with "Pop quiz: Which language boasts faster raw allocation performance, the Java language, or C/C++?"
|
|
Dogen
Junior Member
Posts: 98
|
C++0x
Nov 1, 2008 22:41:11 GMT
Post by Dogen on Nov 1, 2008 22:41:11 GMT
That is very useful information, thank you. So something to take from that is, if you are doing a lot of allocating and deallocating of memory than java, or at least a language with a garbage collector is the way to go. Or implement on in C/C++ lol.
|
|