hi, n e bod know how i can refrag the data in memory?
thx
ow btw, i have the 51 compiler.
hi again,
i have a big block of memory but it is to big to send so i have to send lots of small ones.
someone told me to refragment the big memory into lots of small ones but i do not know how.
does any bode have any code to do it?
ell me know how to do it
You don't need to "refragment" a block of memory, just to send the contents in smaller parts.
Just set a pointer to the start of the big block. Process n bytes. Step pointer forward n bytes. Process n bytes. Step pointer forward n bytes. Repeat until done. Note that the last processed block may have less than n bytes if your big memory block isn't an even multiple of the transfer size.
Only one thing to notice: If your program is allowed to change the contents of the large block during the transfer, then you will not be able to send a "snapshot" contents of the large block. On the other hand - the only possible way to send a snapshot is to forbid updates to the large block while the transfer is active, having enough memory to duplicate the block before you start the transfer or keeping a "change list" and dynamically patch outgoing messages based on previous contents stored in the change list.