Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Clang #1

Closed
wants to merge 6 commits into from
This page is out of date. Refresh to see the latest.
View
1  .travis.yml
@@ -1,6 +1,7 @@
language: cpp
compiler:
- gcc
+ - clang
env:
- DEFAULT_COLLECTOR=Markcompact
- DEFAULT_COLLECTOR=Semispace
View
5 CMakeLists.txt
@@ -14,7 +14,10 @@ add_definitions( -D__STDC_FORMAT_MACROS )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
-set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 --param inline-unit-growth=100000 --param large-function-growth=100000 --param max-inline-insns-single=100000 -Wall -Werror -frtti -Wno-unused-but-set-variable -Wno-strict-aliasing")
+set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall -Werror -frtti -Wno-unused-but-set-variable -Wno-strict-aliasing")
+if(NOT ${CMAKE_CXX_COMPILER} MATCHES "clang")
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --param inline-unit-growth=100000 --param large-function-growth=100000 --param max-inline-insns-single=100000")
+endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_definitions( -DDEBUG )
View
2  include/c9/channel9.hpp
@@ -15,8 +15,8 @@ namespace Channel9
struct RunningContext;
struct RunnableContext;
struct VariableFrame;
+ struct Message;
class IStream;
- class Message;
enum ValueType
{
View
4 include/c9/gc_markcompact.hpp
@@ -66,8 +66,8 @@ namespace Channel9
private:
- static const double GC_GROWTH_LIMIT = 2.0;
- static const double FRAG_LIMIT = 0.8; //compact if the block is less than this full
+ static const uint64_t GC_GROWTH_LIMIT = 2;
+ static const uint64_t FRAG_LIMIT = 80; //compact if the block is less than this full. Expressed as integer percentage (80 is 80% full)
static const uint64_t CHUNK_SIZE = 20; //how much to allocate at a time
static const uint64_t BLOCK_SIZE = 15; //prefer block alignment over page alignment
static const uint64_t PAGE_SIZE = 12; //linux defines 4kb pages, so that's what's used here as mmap guarantees page alignment
View
2  include/c9/gc_semispace.hpp
@@ -89,7 +89,7 @@ namespace Channel9
}
};
- static const double GC_GROWTH_LIMIT = 2.0;
+ static const uint64_t GC_GROWTH_LIMIT = 2;
static const uint64_t CHUNK_SIZE = (2<<20) - sizeof(Chunk) - 8; // 2mb (-8 for the malloc header)
Chunk * m_pools[2]; //two sets of pools, each garbage collection swaps between them, active is stored in m_cur_pool
View
6 src/libc9/gc_markcompact.cpp
@@ -216,7 +216,7 @@ namespace Channel9
TRACE_PRINTF(TRACE_GC, TRACE_DEBUG, "Checking block %p:%p\n", &*c, b);
if(b->m_mark)
{
- if(b->m_in_use < b->m_capacity*FRAG_LIMIT)
+ if(b->m_in_use < b->m_capacity*((double)FRAG_LIMIT/100))
{
for(Data * d = b->begin(); d != b->end(); d = d->next())
{
@@ -248,7 +248,7 @@ namespace Channel9
//clear unused pinned objects
if(m_pinned_block.m_mark)
{
- if(m_pinned_block.m_in_use < m_pinned_block.m_capacity*FRAG_LIMIT)
+ if(m_pinned_block.m_in_use < m_pinned_block.m_capacity*((double)FRAG_LIMIT/100))
{
std::vector<Data*> new_pinned_objs;
for(std::vector<Data*>::iterator i = m_pinned_objs.begin(); i != m_pinned_objs.end(); ++i)
@@ -298,7 +298,7 @@ namespace Channel9
//finishing up
forward.clear();
- m_next_gc = std::max((1<<CHUNK_SIZE)*0.9, m_used * GC_GROWTH_LIMIT);
+ m_next_gc = std::max((1<<CHUNK_SIZE)*0.9, double(m_used) * GC_GROWTH_LIMIT);
TRACE_PRINTF(TRACE_GC, TRACE_INFO, "Sweeping CallableContext objects\n");
View
2  src/libc9/gc_semispace.cpp
@@ -125,7 +125,7 @@ namespace Channel9
m_pinned_objs.swap(new_pinned_objs);
//decide on the next gc cycle
- m_next_gc = std::max(CHUNK_SIZE*0.9, m_used * GC_GROWTH_LIMIT);
+ m_next_gc = std::max(CHUNK_SIZE*0.9, double(m_used) * GC_GROWTH_LIMIT);
TRACE_PRINTF(TRACE_GC, TRACE_INFO, "Sweeping CallableContext objects\n");
View
6 src/libc9/tuple.cpp
@@ -25,9 +25,9 @@ namespace Channel9
if (msg.arg_count() == 2 && is_number(msg.args()[0]) && is_number(msg.args()[1]))
{
const Tuple *self = ptr<Tuple>(oself);
- size_t first = (size_t)msg.args()[0].machine_num,
- last = (size_t)msg.args()[1].machine_num;
- if (first >= 0 && last >= 0 && first <= last && first <= self->size() && last <= self->size())
+ ssize_t first = (ssize_t)msg.args()[0].machine_num,
+ last = (ssize_t)msg.args()[1].machine_num;
+ if (first >= 0 && last >= 0 && first <= last && (size_t)first <= self->size() && (size_t)last <= self->size())
{
return channel_send(cenv, ctx, value(sub_tuple(self, first, last - first)), Nil);
}
Something went wrong with that request. Please try again.