|
-
Jan 23rd, 2003, 01:32 AM
#1
Thread Starter
Hyperactive Member
-
Jan 23rd, 2003, 01:54 AM
#2
Frenzied Member
Assuming C, malloc(). That way you are a bit closer to portable code. Besides, deep down, malloc is implemented with win32 API calls on windows anyway.
If C++, use new, which is generally malloc, and calls a constructor.
Z.
-
Jan 23rd, 2003, 02:00 AM
#3
Thread Starter
Hyperactive Member
-
Jan 23rd, 2003, 05:21 AM
#4
When I write a larger app where I have the CRT anyway I use new in C++. I don't use C.
When writing a small app or maybe only a single utility function I try to stay independent of the CRT and use HeapAlloc.
When I have to allocate really a lot memory (say, more than 1 MB) I use VirtualAlloc unless I really go for portable code.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 23rd, 2003, 12:43 PM
#5
Frenzied Member
If Im writing a small utility, Ill end up writing C, mostly because In the end, Im going to want to use it in Lunix, so I keep the code as standard as possible, in a console.
Z.
-
Jan 23rd, 2003, 03:14 PM
#6
I'm writing them in C++, but still adhering to the standard and not using any features that might not work in not fully compliant libraries.
I used to write small GUI utilities with dialog-based MFC, but in the future I'll write them in C#.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 23rd, 2003, 03:23 PM
#7
Frenzied Member
Originally posted by CornedBee
I'm writing them in C++, but still adhering to the standard and not using any features that might not work in not fully compliant libraries.
I used to write small GUI utilities with dialog-based MFC, but in the future I'll write them in C#.
GUIs take too long to write, so ill either do it in VB, or make it console. My linux computers default to run in console mode, and I cant even get to my server except through telnet, so I guess that explains it =).
Z.
-
Jan 23rd, 2003, 09:33 PM
#8
PowerPoster
Is that VirtualAlloc is using the machine virtual memory? rather than the physical memory?
-
Jan 23rd, 2003, 10:32 PM
#9
No, not that. Virtual refers to the fact that you can reserve an address range using VirtualAlloc without actually mapping the address range to physical memory (RAM or virtual memory). This can have large advantages where you have pointer arithmetics over a large area of pointers (common example is a spreadsheet app with a theoretical array of ~10000*~500 cells) where many of the actual pointers remain unused (most cells are usually empty).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 23rd, 2003, 10:34 PM
#10
Originally posted by Zaei
GUIs take too long to write, so ill either do it in VB, or make it console. My linux computers default to run in console mode, and I cant even get to my server except through telnet, so I guess that explains it =).
Z.
I can't stand VB, so I used MFC dialogs and now C#. Just as quick (especially C#) and more to my style.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|