The MASM Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
MASM32 Downloads
Home
Help
Search
Login
Register
The MASM Forum
»
Projects
»
MASM32
»
Malloc masm32 library problem
« previous
next »
Print
Pages: [
1
]
Author
Topic: Malloc masm32 library problem (Read 7242 times)
bsdsource
Regular Member
Posts: 34
Malloc masm32 library problem
«
on:
January 13, 2014, 09:33:20 AM »
In the masm32 library help file, I see that there is a Malloc and a Free procedure. I attempt to use them and get the following errors:
error A2006:undefined symbol : Malloc
error A2006:undefined symbol : free
I'm not having any other issues from the masm32 library except these 2. There's also some discrepancies in the help file regarding these 2 procedures. In the help file index, iMalloc shows up in the listing but Malloc doesn't. Both iFree and Free show in the index listing for Free. If I click on Free under the index listing I get page can't be found. On the other hand if I click on iFree under the index listing the help page can be found. Can someone explain the this issue?
Logged
jj2007
Member
Posts: 13957
Assembly is fun ;-)
Re: Malloc masm32 library problem
«
Reply #1 on:
January 13, 2014, 09:50:26 AM »
You need to add
crt_
before the malloc and free:
include \masm32\include\masm32rt.inc
.code
start:
xchg rv(crt_malloc, 1000), esi
MsgBox 0, hex$(esi), "Just malloc'ed:", MB_OK
invoke crt_free, esi
exit
end start
Logged
Masm32 Tips, Tricks and Traps
bsdsource
Regular Member
Posts: 34
Re: Malloc masm32 library problem
«
Reply #2 on:
January 13, 2014, 11:58:00 AM »
I'm surprised that information is not in the masm32 lib help file. Thank you for the help. :t
Logged
hutch--
Administrator
Member
Posts: 10583
Mnemonic Driven API Grinder
Re: Malloc masm32 library problem
«
Reply #3 on:
January 13, 2014, 01:14:27 PM »
Thats because its a different function, the old Alloc was written long ago using COM technology and the guy who wrote it has not been around for years. You can use any of a number of techniques, Windows API functions or any of the memory allocation macros in MASM32.
For all of the alternatives, I prefer the "alloc" macro and the "free" macro noting the case difference from the COM versions as they are both easy to use, fast and can handle any amount orf memory.
Logged
hutch at movsd dot com
http://www.masm32.com
bsdsource
Regular Member
Posts: 34
Re: Malloc masm32 library problem
«
Reply #4 on:
January 15, 2014, 01:31:51 AM »
Guess I found some errors in the help file then. Maybe an update is in order for the next release of masm32.
Logged
hutch--
Administrator
Member
Posts: 10583
Mnemonic Driven API Grinder
Re: Malloc masm32 library problem
«
Reply #5 on:
January 15, 2014, 07:38:41 AM »
The help file has been updated long ago and the two functions are only there for backwards compatibility for folks who may have used them. There are better, faster and easier to use capacities in both Windows and the MASM32 SDK. They are not in the help file as they are no longer supported.
Logged
hutch at movsd dot com
http://www.masm32.com
Print
Pages: [
1
]
« previous
next »
The MASM Forum
»
Projects
»
MASM32
»
Malloc masm32 library problem