Back to index

lightning-sunbird  0.9+nobinonly
Functions
w16mem.c File Reference
#include "primpl.h"

Go to the source code of this file.

Functions

PRStatus _MD_AllocSegment (PRSegment *seg, PRUint32 size, void *vaddr)
void _MD_FreeSegment (PRSegment *seg)

Function Documentation

PRStatus _MD_AllocSegment ( PRSegment seg,
PRUint32  size,
void vaddr 
)

Definition at line 52 of file w16mem.c.

{
       PR_ASSERT(seg != 0);
       PR_ASSERT(size != 0);
       PR_ASSERT(vaddr == 0);

       /*     
       ** Take the actual memory for the segment out of our Figment heap.
       */

       seg->vaddr = (char *)malloc(size);

       if (seg->vaddr == NULL) {
              return PR_FAILURE;
       }

       seg->size = size;    

       return PR_SUCCESS;
} /* --- end _MD_AllocSegment() --- */

Definition at line 77 of file w16mem.c.

{
       PR_ASSERT((seg->flags & _PR_SEG_VM) == 0);

       if (seg->vaddr != NULL)
              free( seg->vaddr );
    return;
} /* --- end _MD_FreeSegment() --- */