-
Notifications
You must be signed in to change notification settings - Fork 0
/
alloc.c
79 lines (71 loc) · 1.83 KB
/
alloc.c
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Lyon's Cochlear Model, The Program
* Malcolm Slaney
* Advanced Technology Group
* Apple Computer, Inc.
* November 1988
*
* This program implements a model of acoustic propagation and detection
* in the human cochlea. This model was first described by Richard F.
* Lyon. Please see
* Malcolm Slaney, "Lyon's Cochlear Model, the Mathematica
* Notebook," Apple Technical Report #13, 1988
* for more information. This report is available from the Apple
* Corporate Library.
*
* Warranty Information
* Even though Apple has reviewed this software, Apple makes no warranty
* or representation, either express or implied, with respect to this
* software, its quality, accuracy, merchantability, or fitness for a
* particular purpose. As a result, this software is provided "as is,"
* and you, its user, are assuming the entire risk as to its quality
* and accuracy.
*
* Copyright (c) 1988-1990 by Apple Computer, Inc
* All Rights Reserved.
*
* $Header: alloc.c,v 1.1 90/12/17 17:56:21 malcolm Exp $
*
* $Log: alloc.c,v $
* Revision 1.1 90/12/17 17:56:21 malcolm
* Initial revision
*
*
*/
static char *RCSid = "$Header: alloc.c,v 1.1 90/12/17 17:56:21 malcolm Exp $";
#include <stdio.h>
#ifdef __STDC__
#include <stdlib.h>
#endif /* STDC */
#include "ear.h"
float *
NewFloatArray(size,usage)
int32 size;
char *usage;
{
float *p;
extern char *progname;
p = (float *)calloc(sizeof(*p),size);
if (!p){
fprintf(stderr,"%s: Can't allocate %ld floats for %s.\n",
progname, size, usage);
exit(1);
}
return p;
}
int *
NewIntArray(size,usage)
int32 size;
char *usage;
{
int *p;
extern char *progname;
p = (int *)calloc(sizeof(*p),size);
if (!p){
fprintf(stderr,"%s: Can't allocate %ld floats for %s.\n",
progname, size, usage);
exit(1);
}
return p;
}