Changeset 4162 for trunk/psLib/src/sysUtils
- Timestamp:
- Jun 8, 2005, 1:40:46 PM (21 years ago)
- Location:
- trunk/psLib/src/sysUtils
- Files:
-
- 12 edited
-
psAbort.h (modified) (3 diffs)
-
psConfigure.h (modified) (3 diffs)
-
psError.h (modified) (4 diffs)
-
psErrorCodes.h (modified) (5 diffs)
-
psLogMsg.c (modified) (2 diffs)
-
psLogMsg.h (modified) (3 diffs)
-
psMemory.c (modified) (3 diffs)
-
psMemory.h (modified) (20 diffs)
-
psString.h (modified) (2 diffs)
-
psSysUtilsErrors.h (modified) (3 diffs)
-
psTrace.c (modified) (2 diffs)
-
psType.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psAbort.h
r3264 r4162 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 2-17 19:26:24$14 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-08 23:40:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 29 29 /** Reports an abort message to logging facility 30 30 * 31 * This function will invoke the psLogMsg function with a level of 31 * This function will invoke the psLogMsg function with a level of 32 32 * PS_LOG_ABORT and pass the parameters name and fmt to generate a proper 33 * log message. After logging, this function will call system abort 33 * log message. After logging, this function will call system abort 34 34 * function to abnormally terminate the program. 35 35 * … … 43 43 ); 44 44 45 /* @} */// Doxygen - End of SystemGroup Functions45 /** @} */ // Doxygen - End of SystemGroup Functions 46 46 47 #endif 47 #endif // #ifndef PS_ABORT_H -
trunk/psLib/src/sysUtils/psConfigure.h
r4137 r4162 13 13 * @author Robert DeSonia, MHPCC 14 14 * 15 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-06-0 7 22:53:40$15 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-06-08 23:40:45 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 38 38 /** Initializes persistent memory. 39 39 * 40 * Creates persistant memory items used throughout psLib. Items created 40 * Creates persistant memory items used throughout psLib. Items created 41 41 * within this method should be freed with the psLibFinalize function. 42 42 * current, a non-NULL psErr is returned with code PS_ERR_NONE. … … 61 61 62 62 63 /* @} */63 /** @} */ 64 64 65 #endif 65 #endif // #ifndef PS_CONFIGURE_H -
trunk/psLib/src/sysUtils/psError.h
r3476 r4162 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 3-22 21:52:49$14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-08 23:40:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 104 104 va_list va ///< any parameters required in fmt 105 105 ); 106 #endif 106 #endif // #ifndef SWIG 107 107 108 108 #ifdef DOXYGEN … … 135 135 ... 136 136 ); 137 #else 137 #else // #ifdef DOXYGEN 138 138 psErrorCode p_psError( 139 139 const char* file, … … 157 157 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__) 158 158 #define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__) 159 #endif 159 #endif // #ifndef SWIG 160 160 161 #endif 161 #endif // ! DOXYGEN 162 162 163 163 /** Create a new psErr struct -
trunk/psLib/src/sysUtils/psErrorCodes.h
r3264 r4162 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-08 23:40:45 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 * $2 The error description (rest of the line in psErrorCodes.dat) 26 26 * $n The order of the source line in psErrorCodes.dat (comments excluded) 27 * 27 * 28 28 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. 29 29 */ … … 78 78 /** Retrieves the description of an error code. 79 79 * 80 * The routine psErrorCodeString returns the string associated with an error 80 * The routine psErrorCodeString returns the string associated with an error 81 81 * code. 82 82 * … … 90 90 * 91 91 * Any project needed to use psLib must define the necessary error codes and 92 * associated message strings. This function registers an array of error 92 * associated message strings. This function registers an array of error 93 93 * codes with the error handling subsystem. 94 94 * … … 109 109 /// @} 110 110 111 #endif 111 #endif // #ifndef PS_ERROR_CODES_H -
trunk/psLib/src/sysUtils/psLogMsg.c
r3476 r4162 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 3-22 21:52:49$13 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-08 23:40:45 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 227 227 } 228 228 229 #if !defined(HOST_NAME_MAX)// should be in limits.h229 #ifndef HOST_NAME_MAX // should be in limits.h 230 230 #define HOST_NAME_MAX 256 231 #endif 231 #endif // #ifndef HOST_NAME_MAX 232 232 233 233 /***************************************************************************** -
trunk/psLib/src/sysUtils/psLogMsg.h
r3476 r4162 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 3-22 21:52:49$13 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-08 23:40:45 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 17 17 */ 18 #if !defined(PS_LOG_MSG_H)18 #ifndef PS_LOG_MSG_H 19 19 #define PS_LOG_MSG_H 20 20 #include <stdarg.h> … … 85 85 va_list ap ///< varargs argument list 86 86 ); 87 #endif 87 #endif // #ifndef SWIG 88 88 89 89 ///< Status codes for log messages … … 104 104 /// @} 105 105 106 #endif 106 #endif // #ifndef PS_LOG_MSG_H -
trunk/psLib/src/sysUtils/psMemory.c
r3784 r4162 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 4-29 00:39:22$10 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-08 23:40:45 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 50 50 #ifdef PS_MEM_DEBUG 51 51 static psMemBlock* deadBlockList; // a place to put dead memBlocks in debug mode. 52 #endif 52 #endif // #ifdef PS_MEM_DEBUG 53 53 54 54 /** … … 626 626 } 627 627 deadBlockList = ptr; 628 #else 628 #else // #ifdef PS_MEM_DEBUG 629 629 630 630 pthread_mutex_destroy(&ptr->refCounterMutex); 631 631 free(ptr); 632 #endif 632 #endif // #else - #ifdef PS_MEM_DEBUG 633 633 634 634 } -
trunk/psLib/src/sysUtils/psMemory.h
r3682 r4162 12 12 * @ingroup MemoryManagement 13 13 * 14 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 4-07 20:27:41$14 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-08 23:40:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 18 18 */ 19 19 20 #if !defined(PS_MEMORY_H)20 #ifndef PS_MEMORY_H 21 21 #define PS_MEMORY_H 22 22 … … 125 125 * 126 126 * @return psPtr pointer to the allocated buffer. This will not be NULL. 127 * @see psFree 127 * @see psFree 128 128 */ 129 129 #ifdef DOXYGEN 130 130 psPtr psAlloc(size_t size ///< Size required 131 131 ); 132 #else 132 #else // #ifdef DOXYGEN 133 133 psPtr p_psAlloc(size_t size, ///< Size required 134 134 const char *file, ///< File of call … … 139 139 #ifndef SWIG 140 140 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__) 141 #endif 142 143 #endif 141 #endif // ! SWIG 142 143 #endif // ! DOXYGEN 144 144 145 145 /** Set the deallocator routine 146 146 * 147 * A deallocator routine can optionally be assigned to a memory block to 147 * A deallocator routine can optionally be assigned to a memory block to 148 148 * ensure that associated memory blocks also get freed, e.g., memory buffers 149 149 * referenced within a struct. … … 157 157 /** Get the deallocator routine 158 158 * 159 * This function returns the deallocator for a memory block. A deallocator 160 * routine can optionally be assigned to a memory block to ensure that 161 * associated memory blocks also get freed, e.g., memory buffers referenced 162 * within a struct. 159 * This function returns the deallocator for a memory block. A deallocator 160 * routine can optionally be assigned to a memory block to ensure that 161 * associated memory blocks also get freed, e.g., memory buffers referenced 162 * within a struct. 163 163 * 164 164 * @return psFreeFcn the routine to be called at deallocation. … … 170 170 /** Set the memory as persistent so that it is ignored when detecting memory leaks. 171 171 * 172 * Used to mark a memory block as persistent data within the library, 172 * Used to mark a memory block as persistent data within the library, 173 173 * i.e., non user-level data used to hold psLib's state or cache data. Such 174 174 * examples of this class of memory is psTrace's trace-levels and dynamic … … 185 185 /** Get the memory's persistent flag. 186 186 * 187 * Checks if a memory block has been marked as persistent by 187 * Checks if a memory block has been marked as persistent by 188 188 * p_psMemSetPresistent. 189 189 * … … 207 207 size_t size ///< Size required 208 208 ); 209 #else 209 #else // #ifdef DOXYGEN 210 210 psPtr p_psRealloc( 211 211 psPtr ptr, ///< Pointer to re-allocate … … 218 218 #ifndef SWIG 219 219 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__) 220 #endif 221 222 #endif 220 #endif // ! SWIG 221 222 #endif // ! DOXYGEN 223 223 224 224 /** Free memory. This operates much like free(). … … 230 230 psPtr ptr ///< Pointer to free, if NULL, function returns immediately. 231 231 ); 232 #else 232 #else // #ifdef DOXYGEN 233 233 void p_psFree( 234 234 psPtr ptr, ///< Pointer to free … … 240 240 #ifndef SWIG 241 241 #define psFree(ptr) p_psFree(ptr, __FILE__, __LINE__) 242 #endif 243 244 #endif 242 #endif // ! SWIG 243 244 #endif // ! DOXYGEN 245 245 246 246 /** Check for memory leaks. This scans for allocated memory buffers not freed with an ID not less than id0. … … 299 299 #ifndef SWIG 300 300 #define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__) 301 #endif 302 303 #endif 301 #endif // !SWIG 302 303 #endif // !DOXYGEN 304 304 305 305 /** Decrement reference counter and return the pointer … … 307 307 * @ingroup memRefCount 308 308 * 309 * @return psPtr the pointer deremented in refCount, or NULL if pointer is 309 * @return psPtr the pointer deremented in refCount, or NULL if pointer is 310 310 * fully dereferenced. 311 311 */ … … 314 314 psPtr vptr ///< Pointer to decrement refCounter, and return 315 315 ); 316 #else 316 #else // DOXYGEN 317 317 psPtr p_psMemDecrRefCounter( 318 318 psPtr vptr, ///< Pointer to decrement refCounter, and return … … 323 323 #ifndef SWIG 324 324 #define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__) 325 #endif 326 327 #endif 325 #endif // !SWIG 326 327 #endif // !DOXYGEN 328 328 329 329 /** Set callback for problems. 330 330 * 331 * At various occasions, the memory manager can check the state of the memory 331 * At various occasions, the memory manager can check the state of the memory 332 332 * stack. If any of these checks discover that the memory stack is corrupted, 333 333 * the psMemProblemCallback is called. … … 343 343 /** Set callback for out-of-memory. 344 344 * 345 * If not enough memory is available to satisfy a request by psAlloc or 346 * psRealloc, these functions attempt to find an alternative solution by 347 * calling the psMemExhaustedCallback, a function which may be set by the 348 * programmer in appropriate circumstances, rather than immediately fail. 349 * The typical use of such a feature may be when a program needs a large 350 * chunk of memory to do an operation, but the exact size is not critical. 351 * This feature gives the programmer the opportunity to make a smaller 345 * If not enough memory is available to satisfy a request by psAlloc or 346 * psRealloc, these functions attempt to find an alternative solution by 347 * calling the psMemExhaustedCallback, a function which may be set by the 348 * programmer in appropriate circumstances, rather than immediately fail. 349 * The typical use of such a feature may be when a program needs a large 350 * chunk of memory to do an operation, but the exact size is not critical. 351 * This feature gives the programmer the opportunity to make a smaller 352 352 * request and try again, limiting the size of the operating buffer. 353 353 * … … 362 362 /** Set call back for when a particular memory block is allocated 363 363 * 364 * A private variable, p_psMemAllocateID, can be used to trace the allocation 365 * and freeing of specific memory blocks. If p_psMemAllocateID is set and a 366 * memory block with that ID is allocated, psMemAllocateCallback is called 364 * A private variable, p_psMemAllocateID, can be used to trace the allocation 365 * and freeing of specific memory blocks. If p_psMemAllocateID is set and a 366 * memory block with that ID is allocated, psMemAllocateCallback is called 367 367 * just before memory is returned to the calling function. 368 368 * … … 377 377 /** Set call back for when a particular memory block is freed 378 378 * 379 * A private variable, p_psMemFreeID, can be used to trace the freeing of 380 * specific memory blocks. If p_psMemFreeID is set and the memory block with 379 * A private variable, p_psMemFreeID, can be used to trace the freeing of 380 * specific memory blocks. If p_psMemFreeID is set and the memory block with 381 381 * the ID is about to be freed, the psMemFreeCallback callback is called just 382 382 * before the memory block is freed. … … 400 400 /** set p_psMemAllocateID to specific id 401 401 * 402 * A private variable, p_psMemAllocateID, can be used to trace the allocation 403 * and freeing of specific memory blocks. If p_psMemAllocateID is set and a 404 * memory block with that ID is allocated, psMemAllocateCallback is called 402 * A private variable, p_psMemAllocateID, can be used to trace the allocation 403 * and freeing of specific memory blocks. If p_psMemAllocateID is set and a 404 * memory block with that ID is allocated, psMemAllocateCallback is called 405 405 * just before memory is returned to the calling function. 406 406 * 407 407 * @ingroup memCallback 408 408 * 409 * @return psMemoryId 410 * 411 * @see psMemAllocateCallbackSet 409 * @return psMemoryId 410 * 411 * @see psMemAllocateCallbackSet 412 412 */ 413 413 psMemoryId psMemAllocateCallbackSetID( … … 417 417 /** set p_psMemFreeID to id 418 418 * 419 * A private variable, p_psMemFreeID, can be used to trace the freeing of 420 * specific memory blocks. If p_psMemFreeID is set and the memory block with 419 * A private variable, p_psMemFreeID, can be used to trace the freeing of 420 * specific memory blocks. If p_psMemFreeID is set and the memory block with 421 421 * the ID is about to be freed, the psMemFreeCallback callback is called just 422 422 * before the memory block is freed. … … 442 442 #ifdef __GNUC__ 443 443 #pragma GCC poison malloc realloc calloc free 444 #else 444 #else // __GNUC__ 445 445 #define malloc(S) _Pragma("error Use of malloc is not allowed. Use psAlloc instead.") 446 446 #define realloc(P,S) _Pragma("error Use of realloc is not allowed. Use psRealloc instead.") 447 447 #define calloc(S) _Pragma("error Use of calloc is not allowed. Use psAlloc instead.") 448 448 #define free(P) _Pragma("error Use of free is not allowed. Use psFree instead.") 449 #endif 450 #endif 451 452 #endif 453 // doxygen skip 454 455 #endif // end of header file 449 #endif // ! __GNUC__ 450 #endif // #ifndef PS_ALLOW_MALLOC 451 452 #endif // #ifndef DOXYGEN 453 454 #endif // #ifndef PS_MEMORY_H -
trunk/psLib/src/sysUtils/psString.h
r3998 r4162 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 5-20 01:41:57$15 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-06-08 23:40:45 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 99 99 ); 100 100 101 /* @} */// Doxygen - End of SystemGroup Functions101 /** @} */// Doxygen - End of SystemGroup Functions 102 102 103 #endif 103 #endif // #ifndef PS_STRING_H -
trunk/psLib/src/sysUtils/psSysUtilsErrors.h
r3264 r4162 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-08 23:40:45 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 23 23 * $2 The error text (rest of the line in psSysUtilsErrors.dat) 24 24 * $n The order of the source line in psSysUtilsErrors.dat (comments excluded) 25 * 25 * 26 26 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. 27 27 */ … … 50 50 //~End 51 51 52 #endif 52 #endif // #ifndef PS_SYSUTILS_ERRORS_H -
trunk/psLib/src/sysUtils/psTrace.c
r3850 r4162 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 5-05 21:24:50$11 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-08 23:40:45 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 555 555 } 556 556 557 #endif 557 #endif // #ifndef PS_NO_TRACE -
trunk/psLib/src/sysUtils/psType.h
r3671 r4162 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 4-06 01:12:58$12 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-08 23:40:45 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 62 62 } 63 63 psC64; 64 #else 64 #else // SWIG 65 65 typedef float _Complex psC32; ///< complex with 32-bit floating point Real and Imagary numbers 66 66 typedef double _Complex psC64; ///< complex with 64-bit floating point Real and Imagary numbers 67 #endif 67 #endif // !SWIG 68 68 69 69 typedef void* psPtr; ///< void pointer … … 243 243 /// @} 244 244 245 #endif 245 #endif // #ifndef PS_TYPE_H
Note:
See TracChangeset
for help on using the changeset viewer.
