From 9f66d0028774315b60c29a64a54bf0e3c1fe16ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 May 2018 18:41:59 +0200 Subject: [PATCH 1/2] CMake: only include licences for enabled libs --- source/creator/CMakeLists.txt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index a71c1bb1984..47016cbbb3b 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -265,15 +265,30 @@ endif() set(BLENDER_TEXT_FILES ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt - ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt ${CMAKE_SOURCE_DIR}/release/text/copyright.txt - ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt - ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt # generate this file # ${CMAKE_SOURCE_DIR}/release/text/readme.html ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bfont.ttf.txt ) +if(WITH_PYTHON) + list(APPEND BLENDER_TEXT_FILES + ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt + ) +endif() + +if(WITH_OPENCOLORIO) + list(APPEND BLENDER_TEXT_FILES + ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt + ) +endif() + +if(WITH_MEM_JEMALLOC) + list(APPEND BLENDER_TEXT_FILES + ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt + ) +endif() + if(WITH_INTERNATIONAL) list(APPEND BLENDER_TEXT_FILES ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-droidsans.ttf.txt From 28c20fc3934b404cbce8a9181ae536803abf9444 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 22 May 2018 08:45:47 +0200 Subject: [PATCH 2/2] Memory allocator: use lockfree calls internally Was already used in some areas. --- intern/guardedalloc/intern/mallocn_lockfree_impl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c index 4c6ba0cb256..9575375d90a 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c @@ -171,7 +171,7 @@ void *MEM_lockfree_dupallocN(const void *vmemh) void *newp = NULL; if (vmemh) { MemHead *memh = MEMHEAD_FROM_PTR(vmemh); - const size_t prev_size = MEM_allocN_len(vmemh); + const size_t prev_size = MEM_lockfree_allocN_len(vmemh); if (UNLIKELY(MEMHEAD_IS_MMAP(memh))) { newp = MEM_lockfree_mapallocN(prev_size, "dupli_mapalloc"); } @@ -196,7 +196,7 @@ void *MEM_lockfree_reallocN_id(void *vmemh, size_t len, const char *str) if (vmemh) { MemHead *memh = MEMHEAD_FROM_PTR(vmemh); - size_t old_len = MEM_allocN_len(vmemh); + size_t old_len = MEM_lockfree_allocN_len(vmemh); if (LIKELY(!MEMHEAD_IS_ALIGNED(memh))) { newp = MEM_lockfree_mallocN(len, "realloc"); @@ -235,7 +235,7 @@ void *MEM_lockfree_recallocN_id(void *vmemh, size_t len, const char *str) if (vmemh) { MemHead *memh = MEMHEAD_FROM_PTR(vmemh); - size_t old_len = MEM_allocN_len(vmemh); + size_t old_len = MEM_lockfree_allocN_len(vmemh); if (LIKELY(!MEMHEAD_IS_ALIGNED(memh))) { newp = MEM_lockfree_mallocN(len, "recalloc");