You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Command Syntax: (e.g. stonks [register])
it's free real estate [register/number]
Command Description:
Allocates the provided number of Bytes on the Heap and returns a pointer to the starting address. If the allocation failed, 0 is returned. The memory block cannot be freed - because who does that anyway? (hides)
One thing to note is error handling: the implementation detects if we didn't get any more memory at all (old break == new break), but it doesn't check if we got enough memory (not sure if the kernel would ever return less than we expected instead of the old break, indicating error). Maybe one should do that for a better implementation, or we just follow the MemeAseembly standard in that case
When using a libc (which we do, the programs start at main), using brk is extremely likely to break things. Why not just call... malloc? Otherwise, mmap could be used for memory allocation.
Command Syntax: (e.g.
stonks [register]
)it's free real estate [register/number]
Command Description:
Allocates the provided number of Bytes on the Heap and returns a pointer to the starting address. If the allocation failed,
0
is returned. The memory block cannot be freed - because who does that anyway? (hides)Which x86_64 Assembly instruction(s) would be used to translate this command?
For a possible implementation, see https://github.com/xarantolus/memeasm/blob/main/malloc/malloc.memeasm
What could this command be useful for?
Well.. heap allocation
What Meme is your command based on? (You can also provide a link to e.g. its KnowYourMeme page)
https://knowyourmeme.com/memes/its-free-real-estate
The text was updated successfully, but these errors were encountered: