readium / readium-sdk

A C++ ePub renderer SDK
BSD 3-Clause "New" or "Revised" License
388 stars 164 forks source link

CPU Cache Utils to remove in Android build config! (unnecessary) #248

Closed danielweck closed 8 years ago

danielweck commented 8 years ago

Well, unless ENABLE_SYS_CACHE_FLUSH is defined, the "CPU cache util" stuff should not be included in the build: https://github.com/readium/readium-sdk/blob/develop/ePub3/utilities/byte_buffer.cpp#L27

#ifdef ENABLE_SYS_CACHE_FLUSH
#include "CPUCacheUtils.h"
#endif //ENABLE_SYS_CACHE_FLUSH
...
...

void ByteBuffer::Clean(unsigned char *ptr, size_t len)
{
    bzero(ptr, len);

#ifdef ENABLE_SYS_CACHE_FLUSH
    epub_sys_cache_flush(ptr, len);
#endif //ENABLE_SYS_CACHE_FLUSH
}

See: https://github.com/readium/readium-sdk/commit/0c6c54fa809feddacd92100155e297733d51d89a

Also see: https://github.com/readium/SDKLauncher-iOS/issues/38#issuecomment-66620982

Ah, I see that the "CPU Cache Utils" are included in the build (they can be removed, as they are unused):

https://github.com/readium/readium-sdk/blob/develop/Platform/Android/epub3/Stable.mk#L242 https://github.com/readium/readium-sdk/blob/develop/Platform/Android/epub3/Experimental.mk#L241

LOCAL_SRC_FILES := \
...
    $(EPUB3_PATH)/utilities/CPUCacheUtils_arm.S \
    $(EPUB3_PATH)/utilities/CPUCacheUtils_i386.S \
    $(EPUB3_PATH)/utilities/CPUCacheUtils_x64.S \
    $(EPUB3_PATH)/utilities/CPUCacheUtils.c \
danielweck commented 8 years ago

Fixed in https://github.com/readium/readium-sdk/commit/fe074d5417afd42dde12136868f1ea6259ff4cf2