Changeset 4985:e025032fad89 in roaraudio


Ignore:
Timestamp:
05/20/11 03:38:14 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

only use special zero-size buffer if ROAR_USE_MEMMGR is defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/memmgr.c

    r4974 r4985  
    3636#include "libroar.h" 
    3737 
     38#ifdef ROAR_USE_MEMMGR 
    3839#define NULL_BUFFER_CONST "RoarAudio" 
    3940static char _libroar_null_buffer[] = NULL_BUFFER_CONST; // A byte sequense >= 8 byte. 
     
    4445 memcpy(_libroar_null_buffer, NULL_BUFFER_CONST, sizeof(_libroar_null_buffer)); 
    4546} 
     47#endif 
    4648 
    4749#define _err(x) do { roar_err_set((x)); return NULL; } while (0) 
     
    154156  _err(ROAR_ERROR_FAULT); 
    155157 
     158#ifdef ROAR_USE_MEMMGR 
    156159 if ( len == 0 ) { 
    157160  _libroar_null_buffer_check(); 
    158161  return _libroar_null_buffer; 
    159162 } 
     163#endif 
    160164 
    161165 ret = roar_mm_malloc(len); 
     
    211215  _err(ROAR_ERROR_FAULT); 
    212216 
     217#ifdef ROAR_USE_MEMMGR 
    213218 if ( n == 0 ) { 
    214219  _libroar_null_buffer_check(); 
    215220  return _libroar_null_buffer; 
    216221 } 
     222#endif 
    217223 
    218224#ifdef ROAR_HAVE_STRDUP 
Note: See TracChangeset for help on using the changeset viewer.