source: trunk/src/emx/include/malloc.h@ 123

Last change on this file since 123 was 123, checked in by zap, 22 years ago

Started the work for re-designing the EMX C runtime library to not require
EMX.DLL. The new design is projected to be as follows:

  • all emx syscalls are replaced with the routines from the old sys.lib library which is now compilable in both a.out and OMF formats.
  • the sys.a library should be made replaceable and selectable by some gcc switch (e.g. -msyslib=emx would link with emx.a instead of sys.a which would give almost full backward compatibility with emx).
  • All C functions names were renamed to not contain the starting underscore (e.g. fopen and not _fopen). The underscored aliases will be added later with the c_alias library (which will be generated automatically from all public symbols of libc; any exported symbol that do not start with an underscore will be given an underscored alias unless such a symbol is already defined).

Also a lot of updates to the building system. It is now much faster (thanks
to Knut's suggestion of using ash's builtin echo).
Also re-wrote thunk1.asm and thunk2.asm to GAS format; this removes the need
for MASM and makes it possible to use 16-bit functions in a.out programs
without the need for EMX.DLL.
Also made a lot of small changes I don't remember now.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.1 KB
Line 
1/* malloc.h (emx+gcc) */
2
3#ifndef _MALLOC_H
4#define _MALLOC_H
5
6#if defined (__cplusplus)
7extern "C" {
8#endif
9
10#if !defined (_SIZE_T)
11#define _SIZE_T
12typedef unsigned long size_t;
13#endif
14
15#if !defined (NULL)
16#if defined (__cplusplus)
17#define NULL 0
18#else
19#define NULL ((void *)0)
20#endif
21#endif
22
23
24void *calloc (size_t, size_t);
25void free (void *);
26void *malloc (size_t);
27void *realloc (void *, size_t);
28
29
30#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
31 || defined (_WITH_UNDERSCORE)
32
33#if !defined (_HEAPOK)
34#define _HEAPOK 0
35#define _HEAPEMPTY 1
36#define _HEAPBADBEGIN 2
37#define _HEAPBADNODE 3
38#define _HEAPBADEND 4
39#define _HEAPBADROVER 5
40#endif
41
42void *_tcalloc (size_t, size_t);
43void _tfree (void *);
44int _theapmin (void);
45void *_tmalloc (size_t);
46void *_trealloc (void *, size_t);
47
48void *_expand (void *, size_t);
49int _heapchk (void);
50int _heapmin (void);
51int _heapset (unsigned);
52int _heap_walk (int (*)(__const__ void *, size_t, int, int,
53 __const__ char *, size_t));
54size_t _msize (__const__ void *);
55
56#endif
57
58
59#if defined (__cplusplus)
60}
61#endif
62
63#endif /* not _MALLOC_H */
Note: See TracBrowser for help on using the repository browser.