PDA

View Full Version : Dynamic Allocation



Darkwraith
06-22-2003, 09:55 PM
I know that this is not a forum that explicitly does assembly, but I was directed here from another forum and I was wondering if anyone could help.

My orginal post was:

Is there a way to dynamically allocate memory in the data segment? If so, how?

Someone then suggested to create a memory manager. Does anyone have resources (websites, papers, books, code, etc.) to implement such a thing?

sean
06-27-2003, 11:43 AM
For future reference, flashdaddee.com has an assembly forum.

Darkwraith
06-27-2003, 09:40 PM
Thank you so much!

The one that I have been visiting is not that active. :(

cr_naik
07-03-2003, 10:55 PM
But man....I can't understand why do you want to allocate memory dynamically from data segment. Because data segment is reserved only for a program. No other programs are allowed to used the memory reserved for another one program.

Please let me know.......

Darkwraith
07-06-2003, 10:00 PM
This is part of a project that I am doing (on my own, crazy as that sounds :) ) The user is to input a string, and using some parsing techniques, I will generate an array (list, vector, whatever) of tokens. I am attempting to do this all in assembler.

The problem is that I have no way of knowing how many tokens that I have received until I tokenize it. Furthermore, this array can grow throughout the process. So my thinking on it is that I could split the string up on the fly and use some sort of memory manager to hold the information. When I mean allocating memory, I mean just somehow have a way in which I could mark out sections of the segment to hold data.

VirtualAce
07-07-2003, 06:21 AM
Parse the string, get the token count, create the array, fill the array.

You could use the stack to do this dynamically.

Darkwraith
07-09-2003, 10:00 PM
However, when you create the array, you need to block out some memory. That's where the dynamic allocation comes in.