Skip to content

Commit

Permalink
small reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Apr 23, 2024
1 parent b0236f4 commit bdffb97
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.h linguist-language=C
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address" CACHE STRING "my configurable string" FORCE)
# set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address" CACHE STRING "my configurable string" FORCE)

set(ENABLE_ASAN ON CACHE BOOL "enable address sanitizer" FORCE)
set(ENABLE_ASAN OFF CACHE BOOL "enable address sanitizer" FORCE)

option(INCLUDE_TCP_LISTENER "link TcpListener staticly to the core" TRUE)
option(INCLUDE_LOGGER_TUNNEL "link LoggerTunnel staticly to the core" TRUE)
Expand Down
Empty file removed in_use
Empty file.
12 changes: 6 additions & 6 deletions ww/buffer_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

#define MEMORY_PROFILE HIG2_MEMORY // todo (cmake)

#define BASE_READ_BUFSIZE (1U << 18) // 8K
#define BUFFERPOOL_CONTAINER_LEN ((16 * 4) + (16 * (1 * MEMORY_PROFILE)))
#define BASE_READ_BUFSIZE (1U << 13) // 8K
#define BUFFERPOOL_CONTAINER_LEN ((16 * 4) + (16 * (16 * MEMORY_PROFILE)))
#define BUFFER_SIZE (BASE_READ_BUFSIZE * (MEMORY_PROFILE > 0 ? MEMORY_PROFILE : 1))

static void firstCharge(buffer_pool_t *pool)
{
for (size_t i = 0; i < pool->cap / 2; i++)
for (size_t i = 0; i < (pool->cap / 2); i++)
{
pool->available[i] = newShiftBuffer(pool->buffers_size);
}
Expand Down Expand Up @@ -60,7 +60,7 @@ static void giveMemBackToOs(buffer_pool_t *pool)

shift_buffer_t *popBuffer(buffer_pool_t *pool)
{
return newShiftBuffer(BUFFER_SIZE);
// return newShiftBuffer(BUFFER_SIZE);
if (pool->len <= 0)
{
reCharge(pool);
Expand All @@ -76,8 +76,8 @@ shift_buffer_t *popBuffer(buffer_pool_t *pool)

void reuseBuffer(buffer_pool_t *pool, shift_buffer_t *b)
{
destroyShiftBuffer(b);
return;
// destroyShiftBuffer(b);
// return;
if (*(b->refc) > 1)
{
destroyShiftBuffer(b);
Expand Down
1 change: 0 additions & 1 deletion ww/eventloop/.gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion ww/frand.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "ww.h"
#include "utils/mathutils.h" // users probably want to use min/max
#include "utils/mathutils.h"

// seed initialized by ww (generally time())
// Compute a pseudorandom integer.
Expand Down

0 comments on commit bdffb97

Please sign in to comment.