                                Source Listing                  24-APR-1996 13:22:47    DEC C T4.1-FT2                      Page   1
                                                                24-APR-1996 13:21:36    WORK$:[DAVENPORT.RTL]MEM.C;4

	      1 
	      2 /******************************************************************************
	      3  *
	      4  * Mem.C
	      5  *
	      6  ******************************************************************************/
	      7 
	      8 /******************************************************************************
	      9  *
	     10  * Headers
	     11  *
	     12  ******************************************************************************/
	     13 
	     14 #include <stdio.h>
	    396 
	    397 #include "intrinsic.h"
	    428 #include "mem.h"
	    443 
	    444 /******************************************************************************
	    445  *
	    446  * Local Constants and Macros
	    447  *
	    448  ******************************************************************************/
	    449 
	    450 /******************************************************************************
	    451  *
	    452  * Local Declarations
	    453  *
	    454  ******************************************************************************/
	    455 
	    456 /******************************************************************************
	    457  *
	    458  * Local Prototypes
	    459  *
	    460  ******************************************************************************/
	    461 
	    462 /******************************************************************************
	    463  *
	    464  * MemAlloc
	    465  *
	    466  ******************************************************************************/
	    467 
	    468 #ifdef VMS
	    469 extern Pointer MemAlloc (int size, int initialize)
	    470 #else
       X    471 extern Pointer MemAlloc (size, initialize)
       X    472 
       X    473   int size;
       X    474   int initialize;
       X    475 #endif
	    476 
	    477 {
	    478   Pointer addr;
	    479 
	    480   /* allocate */
	    481   if (initialize) addr = (Pointer) calloc (1, size);
	    482   else            addr = (Pointer) malloc (size);

                                Source Listing                  24-APR-1996 13:22:47    DEC C T4.1-FT2                      Page   2
                                                                24-APR-1996 13:21:36    WORK$:[DAVENPORT.RTL]MEM.C;4

	    483 
	    484   /* return pointer */
	    485   return (addr);
	    486 }
	    487 
	    488 /******************************************************************************
	    489  *
	    490  * MemDealloc
	    491  *
	    492  ******************************************************************************/
	    493 
	    494 #ifdef VMS
	    495 extern Status MemDealloc (Pointer addr)
	    496 #else
       X    497 extern Status MemDealloc (addr)
       X    498 
       X    499   Pointer addr;
       X    500 #endif
	    501 
	    502 {
	    503   /* deallocate */
	    504   free (addr);
	    505 
	    506   /* done */
	    507   return (Success);
	    508 }
	    509 
	    510 /******************************************************************************
	    511  *
	    512  * MemFill
	    513  *
	    514  ******************************************************************************/
	    515 
	    516 #ifdef VMS
	    517 extern Status MemFill (Pointer addr, int size, char data)
	    518 #else
       X    519 extern Status MemFill (addr, size, data)
       X    520 
       X    521   Pointer addr;
       X    522   int     size;
       X    523   char    data;
       X    524 #endif
	    525 
	    526 {
	    527   int    count;
	    528   String p_addr;
	    529 
	    530   p_addr = (String) addr;
	    531 
	    532   /* fill */
	    533   for (count = 0; count < size; count++) *(p_addr++) = data;
	    534 
	    535   /* done */
	    536   return (Success);
	    537 }
	    538 
	    539 /******************************************************************************

                                Source Listing                  24-APR-1996 13:22:47    DEC C T4.1-FT2                      Page   3
                                                                24-APR-1996 13:21:36    WORK$:[DAVENPORT.RTL]MEM.C;4

	    540  *
	    541  * MemCopy
	    542  *
	    543  ******************************************************************************/
	    544 
	    545 #ifdef VMS
	    546 extern Status MemCopy (Pointer to, Pointer from, int size)
	    547 #else
       X    548 extern Status MemCopy (to, from, size)
       X    549 
       X    550   Pointer to;
       X    551   Pointer from;
       X    552   int     size;
       X    553 #endif
	    554 
	    555 {
	    556   String    p_to;
	    557   String    p_from;
	    558 
	    559   p_to = (String) to;
	    560   p_from = (String) from;
	    561 
	    562   /* copy */
	    563   for (size; size > 0; size--) *(p_to++) = *(p_from++);
	    564 
	    565   /* done */
	    566   return (Success);
	    567 }


Command Line
------- ----

CC /NOANSI_ALIAS/ASSUME=(ACCURACY_SENSITIVE,ALIGNED_OBJECTS,WRITABLE_STRING_LITERALS)
/DEBUG=(SYMBOLS,TRACEBACK)/ENDIAN=LITTLE/EXTERN_MODEL=RELAXED_REFDEF/FLOAT=(
G_FLOAT)/GRANULARITY=QUADWORD/INSTRUCTION_SET=FLOATING_POINT/L_DOUBLE_SIZE=128
/LIST/NOMACHINE_CODE/MEMBER_ALIGNMENT/NAMES=UPPERCASE/NESTED_INCLUDE_DIRECTORY=INCLUDE_FILE
/OBJECT/NOOPTIMIZE/PREFIX=(ALL_ENTRIES)/PSECT_MODEL=NOMULTILANGUAGE/ROUNDING_MODE=NEAREST
/SHOW=(HEADER,SOURCE)/SIGNED_CHAR/STANDARD=VAXC/REENTRANCY=TOLERANT/WARNINGS
