-
Notifications
You must be signed in to change notification settings - Fork 2
/
m.h
31 lines (24 loc) · 1.15 KB
/
m.h
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
/* Copyright 1990-2011, Jsoftware Inc. All rights reserved. */
/* License in license.txt. */
/* */
/* Memory Management */
/* ANSI C already has malloc by j.h include of stdlib.h */
#if (SYS & SYS_PCWIN+SYS_PC386+SYS_UNIX) && !(SYS+SYS_ANSI)
#include <malloc.h>
#endif
#if SY_WIN32 && !SY_WINCE
#define FREE(a) HeapFree(jt->heap,0,a)
#define MALLOC(n) (void*)HeapAlloc(jt->heap,0,n)
#else
#define FREE(a) free(a)
#define MALLOC(n) malloc(n)
#endif
typedef struct {I*a;S j;C mflag,unused;} MS;
/* layout of the two words before every A array */
/* a: ptr to next block (when in free list) */
/* address of SMM array, or 0 (when allocated) */
/* j: mfree/msize index */
/* mflag: bit flags */
#define MFHEAD 1 /* head of 64k block (returned by malloc() */
extern I mhb;
extern I mhw;