stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicole Willson" <will...@roguewave.com>
Subject RE: problem in temp_buffer
Date Tue, 25 Jul 2006 17:15:04 GMT
I'm tracking down an issue with temp_buffer in stdlib/utilities.  I'm
confused by a piece of code in source/stdlib/tmpbuf.cpp:
 
if (nbytes <= _RWSTD_TMPBUF_SIZE) {
 
        if (1 == _RWSTD_THREAD_PREINCREMENT (__rw_buffer_busy, false)) {
 
            *pptr = buffer;
 
            // static buffer used, its usage counter stays non-zero
            return _RWSTD_TMPBUF_SIZE / size;
        }
 
        // static buffer not used, decrement its usage counter
        _RWSTD_THREAD_PREDECREMENT (__rw_buffer_busy, false);
    }
 
    _TRY {
        *pptr = __rw_allocate (nbytes, 0);
    }
    _CATCH (...) {
        *pptr  = 0;
        nbytes = 0;
    }
 
    return nbytes / size;

 
What is the purpose of the check against _RWSTD_TMPBUF_SIZE if it is
ignored?

Nicole Willson

Consulting Engineer

Rogue Wave Software, Inc.

A Division of Quovadx

303-545-3210

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message