Website hosting service by Active-Venture.com
  

 Back to Index

Memory Management

Copy

The XSUB-writer's interface to the C memcpy function. The src is the source, dest is the destination, nitems is the number of items, and type is the type. May fail on overlapping copies. See also Move.

 
	void	Copy(void* src, void* dest, int nitems, type)  

Move

The XSUB-writer's interface to the C memmove function. The src is the source, dest is the destination, nitems is the number of items, and type is the type. Can do overlapping moves. See also Copy.

 
	void	Move(void* src, void* dest, int nitems, type)  

New

The XSUB-writer's interface to the C malloc function.

 
	void	New(int id, void* ptr, int nitems, type)  

Newc

The XSUB-writer's interface to the C malloc function, with cast.

 
	void	Newc(int id, void* ptr, int nitems, type, cast)  

NEWSV

Creates a new SV. A non-zero len parameter indicates the number of bytes of preallocated string space the SV should have. An extra byte for a tailing NUL is also reserved. (SvPOK is not set for the SV even if string space is allocated.) The reference count for the new SV is set to 1. id is an integer id between 0 and 1299 (used to identify leaks).

 
	SV*	NEWSV(int id, STRLEN len)  

Newz

The XSUB-writer's interface to the C malloc function. The allocated memory is zeroed with memzero.

 
	void	Newz(int id, void* ptr, int nitems, type)  

Poison

Fill up memory with a pattern (byte 0xAB over and over again) that hopefully catches attempts to access uninitialized memory.

 
	void	Poison(void* dest, int nitems, type)  

Renew

The XSUB-writer's interface to the C realloc function.

 
	void	Renew(void* ptr, int nitems, type)  

Renewc

The XSUB-writer's interface to the C realloc function, with cast.

 
	void	Renewc(void* ptr, int nitems, type, cast)  

Safefree

The XSUB-writer's interface to the C free function.

 
	void	Safefree(void* ptr)  

savepv

Perl's version of strdup(). Returns a pointer to a newly allocated string which is a duplicate of pv. The size of the string is determined by strlen(). The memory allocated for the new string can be freed with the Safefree() function.

 
	char*	savepv(const char* pv)  

savepvn

Perl's version of what strndup() would be if it existed. Returns a pointer to a newly allocated string which is a duplicate of the first len bytes from pv. The memory allocated for the new string can be freed with the Safefree() function.

 
	char*	savepvn(const char* pv, I32 len)  

savesharedpv

A version of savepv() which allocates the duplicate string in memory which is shared between threads.

 
	char*	savesharedpv(const char* pv)  

StructCopy

This is an architecture-independent macro to copy one structure to another.

 
	void	StructCopy(type src, type dest, type)  

Zero

The XSUB-writer's interface to the C memzero function. The dest is the destination, nitems is the number of items, and type is the type.

 
	void	Zero(void* dest, int nitems, type)  

 

  

 

Domain name registration & domain search - 
Register cheap domain name from $7.95 and enjoy free domain services 
 

Cheap domain name search service -
Domain name services at just
$8.95/year only
 

Register domain name -
Buy domain name registration and cheap domain transfer at low, affordable price.

© 2002-2004 Active-Venture.com Web Site Hosting Service

 

[ The memory management on the PowerPC can be used to frighten small children   ]

 

 
 
 

Disclaimer: This documentation is provided only for the benefits of our web hosting customers.
For authoritative source of the documentation, please refer to http://www.perldoc.com