Memory.ReAllocate

number Memory.ReAllocate ( 

number  Memory,

number  NewSize )

Description

Allocates (when parameter Memory is 0) a new or re-allocates (with a valid Memory as parameter) an existing contiguous memory area according to the specified size (in bytes).

Parameters

Memory

(number) Address of SourceMemory.

NewSize

(number) Specified length (in bytes).

Returns

(number) If the needed memory is available, the return value will get the start address of the memory area, else it will be 0 (the existing memory area will remain then, as well its previous Memory stay valid). The content of the previous memory area 'Memory' is kept. If the new 'size' of the memory area is smaller than the previous one, the end is cutted. If the new 'size' is larger than the previous one, the memory area will be filled up with Null.

ResultVariable

When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.

Example

mem = Memory.Allocate(1024) Dialog.Message("Size of Memory", Memory.Size(mem)) mem = Memory.ReAllocate(mem, 2048) Dialog.Message("NewSize of Memory", Memory.Size(mem)) Memory.Free(mem)

See also:  Related Actions

Сайт управляется системой uCoz