LayerAS_Layer
ObjectMemory_Allocation

Memory allocation object.



Method Summary
 Method
 
void ASfree(void* ptr)
Frees the specified memory block.
 
void* ASmalloc(os_size_t nBytes)
Allocates and returns a pointer to a memory block containing the specified number of bytes.
 
void* ASrealloc(void* ptr, os_size_t newNBytes)
If possible, extends the given block and simply returns ptr. Otherwise, it allocates a new block of newNBytes bytes, copies the contents from the old pointer into the new block, frees the old pointer, and returns the pointer to the new block. If a new block cannot be allocated, the call fails and ptr is not freed. Reallocating a block to a smaller size will never fail.




Method Detail
ASfree()
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void ASfree(void* ptr)

Frees the specified memory block.

Parameters

ptr — 

IN/OUT The block of memory to free.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

Examples

go to source arrow ASfree(prfldPasswd);
go to source arrow ASfree(userPwd);
go to source arrow ASfree(prfldPasswd);

more...

File: ASProcs.h
Line: 115
ASmalloc() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void* ASmalloc(os_size_t nBytes)

Allocates and returns a pointer to a memory block containing the specified number of bytes.

Parameters

nBytes — 

IN/OUT The number of bytes for which space is allocated.

Returns

A pointer to the allocated memory, NULL on failure.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

Examples

go to source arrow ASUns8* bufLUT = (ASUns8*)ASmalloc(sizeLUT * baseNumComps);
go to source arrow ASUns8* rCompStr = (ASUns8*)ASmalloc(sizeLUT);
go to source arrow ASUns8* gCompStr = (ASUns8*)ASmalloc(sizeLUT);

more...

File: ASProcs.h
Line: 86
ASrealloc() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void* ASrealloc(void* ptr, os_size_t newNBytes)

If possible, extends the given block and simply returns ptr. Otherwise, it allocates a new block of newNBytes bytes, copies the contents from the old pointer into the new block, frees the old pointer, and returns the pointer to the new block. If a new block cannot be allocated, the call fails and ptr is not freed. Reallocating a block to a smaller size will never fail.

Parameters

ptr — 

IN/OUT The existing memory block.

 
newNBytes — 

IN/OUT The number of bytes the memory block must be able to hold.

Returns

A pointer to memory block.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

File: ASProcs.h
Line: 105