---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------*/ * This routine attempts to allocate the specified number of * bytes. If the memory can be allocated, a pointer to the * memory is returned. If the memory cannot be allocated, or * if the allocation request is nega
| 45 | * @note History: 4/3/89, DSJ, Created. |
| 46 | */ |
| 47 | void *Emalloc(int Size) { |
| 48 | void *Buffer; |
| 49 | |
| 50 | if (Size <= 0) |
| 51 | DoError (ILLEGALMALLOCREQUEST, "Illegal malloc request size"); |
| 52 | Buffer = (void *) malloc (Size); |
| 53 | if (Buffer == NULL) { |
| 54 | DoError (NOTENOUGHMEMORY, "Not enough memory"); |
| 55 | return (NULL); |
| 56 | } |
| 57 | else |
| 58 | return (Buffer); |
| 59 | |
| 60 | } /* Emalloc */ |
| 61 | |
| 62 | |
| 63 | /*---------------------------------------------------------------------------*/ |