Permalink
Browse files

move tlsf back into its own directory so coverity doesn't get confused

  • Loading branch information...
gafferongames committed Jan 5, 2017
1 parent 1c71b9c commit df449453693a6e4fc3957e76fa4bb001fa936940
View
@@ -6,6 +6,7 @@ copy ..\*.h libyojimbo
copy ..\*.cpp libyojimbo
copy ..\tests\*.* libyojimbo\tests
copy ..\premake5.lua libyojimbo
robocopy /MIR /DCOPY:T ..\tlsf libyojimbo\tlsf
robocopy /MIR /DCOPY:T ..\rapidjson libyojimbo\rapidjson
REM because robocopy returns non-zero error codes on successful operation. what the actual fuck windows
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"
View
@@ -45,7 +45,7 @@ project "info"
project "yojimbo"
kind "StaticLib"
files { "yojimbo.h", "yojimbo.cpp", "yojimbo_*.h", "yojimbo_*.cpp" }
files { "yojimbo.h", "yojimbo.cpp", "yojimbo_*.h", "yojimbo_*.cpp", "tlsf/tlsf.h", "tlsf/tlsf.c" }
project "client"
files { "tests/client.cpp", "tests/shared.h" }
@@ -172,7 +172,7 @@ if not os.is "windows" then
description = "Build and run a yojimbo server inside a docker container",
execute = function ()
os.execute "docker run --rm --privileged alpine hwclock -s" -- workaround for clock getting out of sync on macos. see https://docs.docker.com/docker-for-mac/troubleshoot/#issues
os.execute "rm -rf docker/libyojimbo && mkdir -p docker/libyojimbo && mkdir -p docker/libyojimbo/tests && cp *.h docker/libyojimbo && cp *.cpp docker/libyojimbo && cp premake5.lua docker/libyojimbo && cp tests/* docker/libyojimbo/tests && cp -R rapidjson docker/libyojimbo && cd docker && docker build -t \"networkprotocol:yojimbo-server\" . && rm -rf libyojimbo && docker run -ti -p 40000:40000/udp networkprotocol:yojimbo-server"
os.execute "rm -rf docker/libyojimbo && mkdir -p docker/libyojimbo && mkdir -p docker/libyojimbo/tests && cp *.h docker/libyojimbo && cp *.cpp docker/libyojimbo && cp premake5.lua docker/libyojimbo && cp tests/* docker/libyojimbo/tests && cp -R rapidjson docker/libyojimbo && cp -R tlsf docker/libyojimbo && cd docker && docker build -t \"networkprotocol:yojimbo-server\" . && rm -rf libyojimbo && docker run -ti -p 40000:40000/udp networkprotocol:yojimbo-server"
end
}
@@ -241,7 +241,7 @@ if not os.is "windows" then
trigger = "cppcheck",
description = "Run cppcheck over the source code and write to cppcheck.txt",
execute = function ()
os.execute "cppcheck *.h *.cpp --force --std=c++03 --language=c++ --quiet -U min -U max 2>&1 --config-exclude=rapidjson --suppress=incorrectStringBooleanError --suppress=cstyleCast --suppress=unusedFunction --suppress=unusedStructMember --suppress=variableScope --suppress=memsetClassFloat --enable=warning --enable=performance --enable=style --platform=native -j 32 | tee -a cppcheck.txt"
os.execute "cppcheck *.h *.cpp --force --std=c++03 --language=c++ --quiet -U min -U max 2>&1 --config-exclude=rapidjson --config-exclude=tlsf --suppress=incorrectStringBooleanError --suppress=cstyleCast --suppress=unusedFunction --suppress=unusedStructMember --suppress=variableScope --suppress=memsetClassFloat --enable=warning --enable=performance --enable=style --platform=native -j 32 | tee -a cppcheck.txt"
end
}
@@ -279,7 +279,7 @@ if not os.is "windows" then
execute = function ()
_ACTION = "clean"
premake.action.call( "clean" )
files_to_zip = "README.md BUILDING.md CHANGES.md ROADMAP.md *.cpp *.h premake5.lua docker tests rapidjson windows"
files_to_zip = "README.md BUILDING.md CHANGES.md ROADMAP.md *.cpp *.h premake5.lua docker tests rapidjson tlsf windows"
os.execute( "rm -rf *.zip *.tar.gz" );
os.execute( "rm -rf docker/libyojimbo" );
os.execute( "zip -9r libyojimbo-" .. libyojimbo_version .. ".zip " .. files_to_zip )
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include "yojimbo_tlsf.h"
#include "tlsf.h"
#if defined(__cplusplus)
#define tlsf_decl inline
@@ -883,14 +883,14 @@ int tlsf_check(tlsf_t tlsf)
static void default_walker(void* ptr, size_t size, int used, void* user)
{
(void)user;
printf("\t%p %s size: %x (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, (void*)block_from_ptr(ptr) );
printf("\t%p %s size: %x (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, block_from_ptr(ptr));
}
void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user)
{
tlsf_walker pool_walker = walker ? walker : default_walker;
block_header_t* block =
offset_to_block(pool, size_t(-(int)block_header_overhead));
offset_to_block(pool, -(int)block_header_overhead);
while (block && !block_is_last(block))
{
@@ -996,7 +996,7 @@ pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes)
** so that the prev_phys_block field falls outside of the pool -
** it will never be used.
*/
block = offset_to_block(mem, size_t(-(tlsfptr_t)block_header_overhead));
block = offset_to_block(mem, -(tlsfptr_t)block_header_overhead);
block_set_size(block, pool_bytes);
block_set_free(block);
block_set_prev_used(block);
@@ -1014,7 +1014,7 @@ pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes)
void tlsf_remove_pool(tlsf_t tlsf, pool_t pool)
{
control_t* control = tlsf_cast(control_t*, tlsf);
block_header_t* block = offset_to_block(pool, size_t(-(int)block_header_overhead));
block_header_t* block = offset_to_block(pool, -(int)block_header_overhead);
int fl = 0, sl = 0;
File renamed without changes.
View
@@ -31,6 +31,8 @@
#include <stdio.h>
#endif // #if YOJIMBO_DEBUG_MEMORY_LEAKS
#include "tlsf/tlsf.h"
namespace yojimbo
{
Allocator::Allocator()
View
@@ -31,10 +31,10 @@
#include <map>
#endif // YOJIMBO_DEBUG_MEMORY_LEAKS
#include "yojimbo_tlsf.h"
/** @file */
typedef void* tlsf_t;
namespace yojimbo
{
/**

0 comments on commit df44945

Please sign in to comment.