Changeset 5216 for trunk/psLib/src/sys/psMemory.c
- Timestamp:
- Sep 30, 2005, 4:22:26 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.c
r4971 r5216 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005- 09-08 00:17:26$10 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-10-01 02:22:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 583 583 } 584 584 585 psPtr p_psMemSetRefCounter( 586 psPtr vptr, 587 psReferenceCount count, 588 const char *file, 589 psS32 lineno) 590 { 591 psMemBlock* ptr; 592 593 if (vptr == NULL) { 594 return vptr; 595 } 596 597 if (count < 0) { 598 count = 0; 599 } 600 601 ptr = ((psMemBlock* ) vptr) - 1; 602 603 if (checkMemBlock(ptr, __func__)) { 604 memProblemCallback(ptr, file, lineno); 605 } 606 607 pthread_mutex_lock(&ptr->refCounterMutex); 608 ptr->refCounter = count; 609 pthread_mutex_unlock(&ptr->refCounterMutex); 610 611 if (count < 1) { 612 vptr = p_psMemDecrRefCounter(vptr,file,lineno); 613 } 614 615 return vptr; 616 } 617 585 618 // decrement and return refCounter 586 619 psPtr p_psMemDecrRefCounter(psPtr vptr, … … 707 740 return PTR->freeFunc; 708 741 } 709 710 742 711 743 bool psMemCheckType(psDataType type,
Note:
See TracChangeset
for help on using the changeset viewer.
