diff --git a/src/core/SkVarAlloc.cpp b/src/core/SkVarAlloc.cpp index ba5d6f50b..88bd17028 100644 --- a/src/core/SkVarAlloc.cpp +++ b/src/core/SkVarAlloc.cpp @@ -47,7 +47,7 @@ void SkVarAlloc::makeSpace(size_t bytes, unsigned flags) { #if defined(SK_BUILD_FOR_MAC) SkASSERT(alloc == malloc_good_size(alloc)); -#elif defined(SK_BUILD_FOR_UNIX) +#elif defined(SK_BUILD_FOR_UNIX) && !defined(__UCLIBC__) // TODO(mtklein): tune so we can assert something like this //SkASSERT(alloc == malloc_usable_size(fBlock)); #endif @@ -56,7 +56,7 @@ void SkVarAlloc::makeSpace(size_t bytes, unsigned flags) { static size_t heap_size(void* p) { #if defined(SK_BUILD_FOR_MAC) return malloc_size(p); -#elif defined(SK_BUILD_FOR_UNIX) +#elif defined(SK_BUILD_FOR_UNIX) && !defined(__UCLIBC__) return malloc_usable_size(p); #elif defined(SK_BUILD_FOR_WIN32) return _msize(p); diff --git a/tests/VarAllocTest.cpp b/tests/VarAllocTest.cpp index 18e421480..b1a0cb352 100644 --- a/tests/VarAllocTest.cpp +++ b/tests/VarAllocTest.cpp @@ -6,8 +6,8 @@ DEF_TEST(VarAlloc, r) { char* p = va.alloc(128, SK_MALLOC_THROW); sk_bzero(p, 128); // Just checking this is safe. -#ifndef SK_BUILD_FOR_ANDROID - // This method will always return 0 on Android. +#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) + // This method will always return 0 on Android and UCLIBC platforms. REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128); #endif }