Edinburgh Speech Tools  2.1-release
system.c
Go to the documentation of this file.
1 /*************************************************************************/
2 /* */
3 /* Copyright (c) 1997-98 Richard Tobin, Language Technology Group, HCRC, */
4 /* University of Edinburgh. */
5 /* */
6 /* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, */
7 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
8 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
9 /* IN NO EVENT SHALL THE AUTHOR OR THE UNIVERSITY OF EDINBURGH BE LIABLE */
10 /* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF */
11 /* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION */
12 /* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
13 /* */
14 /*************************************************************************/
15 #include <stdlib.h>
16 #include "stdio16.h"
17 #include "system.h"
18 
19 void *Malloc(int bytes)
20 {
21  void *mem = malloc(bytes);
22  if(!mem)
23  Fprintf(Stderr, "malloc failed\n");
24  return mem;
25 }
26 
27 void *Realloc(void *mem, int bytes)
28 {
29  mem = mem ? realloc(mem, bytes) : malloc(bytes);
30  if(!mem)
31  Fprintf(Stderr, "realloc failed\n");
32  return mem;
33 }
34 
35 void Free(void *mem)
36 {
37  if (mem != 0) free(mem);
38 }
39 
STD_API FILE16 * Stderr
Definition: stdio16.c:123
void * Realloc(void *mem, int bytes)
Definition: system.c:27
void Free(void *mem)
Definition: system.c:35
void * Malloc(int bytes)
Definition: system.c:19
STD_API int Fprintf(FILE16 *file, const char *format,...)
Definition: stdio16.c:365