Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

#include "ue.h"


#define max(a,b) ((a > b)? a : b)

static int gflag = 0;

#if PMMALLOC

typedef unsigned int UI;
typedef unsigned long UL;

Expand All @@ -33,7 +36,6 @@ typedef struct HEAP
static HEAP rheaplist = { (HEAP *) NULL };
static HEAP gheaplist = { (HEAP *) NULL };

static int gflag = 0;

/* The list of heaps is in descending order of their addresses */

Expand Down Expand Up @@ -277,6 +279,8 @@ fragmentation caused by the markedly different expected life times of
the malloc'd areas: gheaplist for use in the shell part, and rheaplist
in the uE part. */

#endif

void *gmalloc(unsigned int n)
{
char *p;
Expand All @@ -300,6 +304,7 @@ back to the single line oriented shell mode. */

void freeall(void)
{
#if PMMALLOC
HEAP *heap;
HEAP *h;

Expand All @@ -308,4 +313,5 @@ void freeall(void)
heap->hlink = h->hlink;
Mfree(h);
}
#endif
}