summaryrefslogtreecommitdiff
path: root/pl/plalloc.c
blob: 61f7f15e85306078de7e028e904c90f94f57dd14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Allocator for languages (pcl, xps, etc.), simply uses the chunk
   memory manager see gsmchunk.c */

/*$Id$*/

#include "std.h"
#include "gsmalloc.h"
#include "gsalloc.h"
#include "plalloc.h"
#include "gsmchunk.h"

gs_memory_t *
pl_alloc_init()
{
    gs_memory_t *mem = gs_malloc_init();
    gs_memory_t *pl_mem;
    int code;

    if (mem == NULL)
        return NULL;

#ifdef HEAP_ALLOCATOR_ONLY
    return mem;
#endif

    code = gs_memory_chunk_wrap(&pl_mem, mem);
    if (code < 0)
        return NULL;

    return pl_mem;
}