Changeset 11248 for trunk/psLib/src/sys/psMemory.h
- Timestamp:
- Jan 23, 2007, 12:47:23 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.h (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.h
r9538 r11248 1 /** @file psMemory.h 2 * 3 * @brief Contains the definitions for the memory management system 4 * 5 * This is the generic memory management system put inbetween the user's high level code and the OS-level 6 * memory allocation routines. This system adds such features as callback routines for memory error events, 7 * tracing capabilities, and reference counting. 8 * 9 * @author Robert DeSonia, MHPCC 10 * @author Robert Lupton, Princeton University 11 * 12 * @ingroup MemoryManagement 13 * 14 * @version $Revision: 1.61 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-10-13 21:13:48 $ 16 * 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 1 /* @file psMemory.h 2 * 3 * @brief Contains the definitions for the memory management system 4 * 5 * This is the generic memory management system put inbetween the user's high level code and the OS-level 6 * memory allocation routines. This system adds such features as callback routines for memory error events, 7 * tracing capabilities, and reference counting. 8 * 9 * @author Robert Lupton, Princeton University 10 * @author Robert DeSonia, MHPCC 11 * 12 * $Revision: 1.62 $ $Name: not supported by cvs2svn $ 13 * $Date: 2007-01-23 22:47:23 $ 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 18 15 */ 19 16 … … 21 18 #define PS_MEMORY_H 22 19 20 /// @addtogroup SysUtils System Utilities 21 /// @{ 22 23 23 #include <stdio.h> // needed for FILE 24 24 #include <pthread.h> // we need a mutex to make this stuff thread safe. 25 26 25 #include "psType.h" 27 26 28 /** @addtogroup MemoryManagement29 * @{30 */31 32 27 #define P_PS_MEMMAGIC (psPtr)0xdeadbeef // Magic number in psMemBlock header 33 34 /**35 * @addtogroup memCallback Memory Callbacks36 *37 * Routines dealing with the creating and setting of memory management callback functions.38 */39 40 /**41 * @addtogroup memTracing Memory Tracing42 *43 * Routines dealing with memory tracing and corruption checking.44 */45 46 /**47 * @addtogroup memRefCount Reference Count48 *49 * Routines dealing with the reference counting of allocated buffers.50 */51 28 52 29 /// typedef for memory identification numbers. Guaranteed to be some variety of integer. … … 84 61 * 85 62 * @see psMemAllocCallbackSet 86 * @ingroup memCallback87 63 */ 88 64 typedef psMemId(*psMemAllocCallback) ( … … 93 69 * 94 70 * @see psMemFreeCallbackSet 95 * @ingroup memCallback96 71 */ 97 72 typedef psMemId(*psMemFreeCallback) ( … … 104 79 * 105 80 * @see psMemProblemCallbackSet 106 * @ingroup memCallback107 81 */ 108 82 typedef void (*psMemProblemCallback) ( … … 118 92 * 119 93 * @see psMemExhaustedCallbackSet 120 * @ingroup memCallback121 94 */ 122 95 typedef psPtr (*psMemExhaustedCallback) ( … … 303 276 * blocks above id0 that have not been freed. 304 277 * @see psAlloc, psFree, psgetMemId, psMemProblemCallbackSet 305 * @ingroup memTracing306 278 */ 307 279 int psMemCheckLeaks( … … 317 289 * @return int 318 290 * 319 * @ingroup memTracing320 291 */ 321 292 int psMemCheckCorruption( … … 327 298 * @return psReferenceCount 328 299 * 329 * @ingroup memRefCount330 300 */ 331 301 psReferenceCount psMemGetRefCounter( … … 337 307 * @return psPtr 338 308 * 339 * @ingroup memRefCount340 309 */ 341 310 #ifdef DOXYGEN … … 358 327 /** Decrement reference counter and return the pointer 359 328 * 360 * @ingroup memRefCount361 329 * 362 330 * @return psPtr the pointer deremented in refCount, or NULL if pointer is … … 381 349 382 350 /** Set reference counter and return the pointer 383 *384 * @ingroup memRefCount385 351 * 386 352 * @return psPtr the pointer with refCount set, or NULL if pointer is … … 411 377 * stack. If any of these checks discover that the memory stack is corrupted, 412 378 * the psMemProblemCallback is called. 413 414 * @ingroup memCallback415 379 * 416 380 * @return psMemProblemCallback old psMemProblemCallback function … … 431 395 * request and try again, limiting the size of the operating buffer. 432 396 * 433 * @ingroup memCallback434 *435 397 * @return psMemExhaustedCallback old psMemExhaustedCallback function 436 398 */ … … 446 408 * just before memory is returned to the calling function. 447 409 * 448 * @ingroup memCallback449 *450 410 * @return psMemAllocCallback old psMemAllocCallback function 451 411 */ … … 461 421 * before the memory block is freed. 462 422 * 463 * @ingroup memCallback464 *465 423 * @return psMemFreeCallback old psMemFreeCallback function 466 424 */ … … 471 429 /** get next memory ID 472 430 * 473 * @ingroup memCallback474 *475 431 * @return psMemId the next memory ID to be used 476 432 */ … … 478 434 479 435 /** get the last memory ID used 480 *481 * @ingroup memCallback482 436 * 483 437 * @return psMemId the last memory ID used … … 492 446 * just before memory is returned to the calling function. 493 447 * 494 * @ingroup memCallback495 *496 448 * @return psMemId 497 449 * … … 509 461 * before the memory block is freed. 510 462 * 511 * @ingroup memCallback512 *513 463 * @return psMemId the old p_psMemFreeID 514 464 * … … 530 480 size_t *freelist); ///< memory that's waiting to be recycled 531 481 532 // @} End of Memory Management Functions482 /// @} end of SysUtils 533 483 534 484 #ifndef DOXYGEN … … 549 499 550 500 #endif // #ifndef DOXYGEN 551 552 501 #endif // #ifndef PS_MEMORY_H
Note:
See TracChangeset
for help on using the changeset viewer.
