NAME
reorder - re-order an array of memory blocks

SYNTAX
#include "memory.h"

void reorder(char *memory, INT32 nitems, INT32 size,INT32 *order);

DESCRIPTION
This function takes an array of memory blocks and re-organizes them according to the argument 'order'. 'nitems' tells how many memory blocks there are, and 'size' tells how big they are in bytes. 'order' is simply an array of INT32 of size 'nitems' in which each int tells which memory block from 'memory' should be placed in that position. In pseudo code, this could be written as:

mem_copy=copy_memory(memory);
for(int e=0;e<nitems;e++)

memory[e]=mem_copy[order[e]];

KEYWORDS
low_level