Example #1
0
  int streambuf::doallocate() {

    char *buf;

    __lock_it( __b_lock );
    buf = (char *)_plib_malloc( DEFAULT_BUF_SIZE );
    if( buf == NULL ) {
        return( EOF );
    }
    setb( buf, buf + DEFAULT_BUF_SIZE, 1 );
    return( __NOT_EOF );          // something other than EOF!
  }
Example #2
0
int streambuf::doallocate() {
/***************************/
// Do the allocation required if allocate() thinks it's needed.
// If the allocation fails, return EOF.

    char *buf;

    __lock_it( __b_lock );
    buf = (char *)_plib_malloc( DEFAULT_BUF_SIZE );
    if( buf == NULL ) {
        return( EOF );
    }
    setb( buf, buf + DEFAULT_BUF_SIZE, 1 );
    return( __NOT_EOF );          // something other than EOF!
}