Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtxMemory.h File Reference

Memory management function and macro definitions. More...

#include "rtxsrc/rtxCommon.h"
#include "rtxsrc/rtxSysTypes.h"

Go to the source code of this file.

Defines

#define RT_MH_DONTKEEPFREE   0x1
#define OSRTMH_PROPID_DEFBLKSIZE   1
#define OSRTMH_PROPID_SETFLAGS   2
#define OSRTMH_PROPID_CLEARFLAGS   3
#define OSRTMH_PROPID_USER   10
#define OSRTXM_K_MEMBLKSIZ   (4*1024)
#define OSRTALLOCTYPE(pctxt, type)   (type*) rtxMemHeapAlloc (&(pctxt)->pTypeMemHeap, sizeof(type))
 This macro allocates a single element of the given type.
#define OSRTALLOCTYPEZ(pctxt, type)   (type*) rtxMemHeapAllocZ (&(pctxt)->pTypeMemHeap, sizeof(type))
 This macro allocates and zeros a single element of the given type.
#define OSRTARRAYSIZE(x)   (sizeof(x)/sizeof(x[0]))
 This macro returns the number of elements in an array.
#define OSCRTMALLOC0(nbytes)   malloc(nbytes)
#define OSCRTFREE0(ptr)   free(ptr)
#define OSCRTMALLOC   OSMALLOC
#define OSCRTFREE   OSFREEPTR
#define OSCDECL
#define rtxMemAllocType(pctxt, type)   (type*) rtxMemAllocZ ((pctxt), sizeof(type))

Typedefs

typedef void *OSCDECL * OSMallocFunc (size_t size)
typedef void *OSCDECL * OSReallocFunc (void *ptr, size_t size)

Functions

void rtxMemSetAllocFuncs (OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func)
 This function sets the pointers to standard allocation functions.
OSBOOL rtxMemIsZero (const void *pmem, size_t memsiz)
 This helper function determines if an arbitrarily sized block of memory is set to zero.
void * rtxMemAlloc (OSCTXT *pctxt, size_t nbytes)
 This function allocates dynamic memory.
void * rtxMemAllocZ (OSCTXT *pctxt, size_t nbytes)
 This function allocates dynamic memory and sets the allocated buffer to zero.
void rtxMemFree (OSCTXT *pctxt)
 This function frees all memory associated with a given context.
void rtxMemFreePtr (OSCTXT *pctxt, void *mem_p)
 This function frees dynamic memory that was previously allocated by a call to the rtxMemAlloc, rtxMemAllocZ, or rtxMemRealloc memory allocation functions (or associated macros).
void * rtxMemRealloc (OSCTXT *pctxt, void *mem_p, size_t oldnbytes, size_t nbytes)
 This function changes the size of an allocated dynamic memory segment.


Detailed Description

Memory management function and macro definitions.

Definition in file rtxMemory.h.


This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9