flat assembler
Message board for the users of flat assembler.

Index > Windows > Dismiss memory in "proc" macro

Author
Thread Post new topic Reply to topic
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
How i can dismiss memory area which was used in "proc" macro. I was think that will enough come-back value of ebp register.
Sorry for my English.
Post 28 Aug 2011, 10:32
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
you mean restore the value of ebp? You just push it in the first place then pop it when you are done before returning.
Post 28 Aug 2011, 11:32
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Isn't the "proc" macro dismisses that memory by itself?
Post 28 Aug 2011, 11:49
View user's profile Send private message Send e-mail Reply with quote
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
Yes i was try do it in this way:
Code:
proc SearchDisk uses ebx esi edi ebp, StartPath, NameSearchFor, win32_find_data, ProcAddress
pushfd
locals
         ...
endl
         ...
popfd
ret
endp    


But i steel have strange situation:
This procedure used about 56MB RAM. Now If I call this procedure in my program two times:
Code:
   invoke   SearchDisk, 'c:','*',WFD, ProcAddress
; at now task manager shold show RAM expandable = before call SearchDisk ??? please tell me if i be mistaken in this point.
; It belongs to remember that the SearchDisk it recurrent procedure.
; Anyway so no happend and after next call need RAM grows
   invoke   SearchDisk, 'd:','*',WFD, ProcAddress    

I suspect that it will happend because i not relase memory in right way


Last edited by marcinzabrze12 on 28 Aug 2011, 16:33; edited 1 time in total
Post 28 Aug 2011, 12:05
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
I think it's the data that is being added to your data variables
Post 28 Aug 2011, 16:28
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.