mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
cleanups
This commit is contained in:
parent
595bb4fe8a
commit
17a6aebcb6
2 changed files with 9 additions and 11 deletions
|
@ -63,8 +63,8 @@ void table_header(struct table *t)
|
|||
{ NOINDENT
|
||||
struct log *l = global_log ? global_log : &default_log;
|
||||
|
||||
if (t->width != l->window.ws_col - 24)
|
||||
table_resize(t, l->window.ws_col - 24);
|
||||
if (t->width != l->window.ws_col - 30)
|
||||
table_resize(t, l->window.ws_col - 30);
|
||||
|
||||
char *line1 = strf("\b\b" BOX_UD);
|
||||
char *line0 = strf("\b");
|
||||
|
@ -115,8 +115,8 @@ void table_row(struct table *t, ...)
|
|||
{ NOINDENT
|
||||
struct log *l = global_log ? global_log : &default_log;
|
||||
|
||||
if (t->width != l->window.ws_col - 24) {
|
||||
table_resize(t, l->window.ws_col - 24);
|
||||
if (t->width != l->window.ws_col - 30) {
|
||||
table_resize(t, l->window.ws_col - 30);
|
||||
table_header(t);
|
||||
}
|
||||
|
||||
|
@ -150,8 +150,8 @@ void table_footer(struct table *t)
|
|||
{ NOINDENT
|
||||
struct log *l = global_log ? global_log : &default_log;
|
||||
|
||||
if (t->width != l->window.ws_col - 24)
|
||||
table_resize(t, l->window.ws_col - 24);
|
||||
if (t->width != l->window.ws_col - 30)
|
||||
table_resize(t, l->window.ws_col - 30);
|
||||
|
||||
char *line = strf("\b");
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ int memory_heap_free(struct memtype *m, void *ptr, size_t len)
|
|||
/** Allocate memory backed by hugepages with malloc() like interface */
|
||||
static void * memory_hugepage_alloc(struct memtype *m, size_t len, size_t alignment)
|
||||
{
|
||||
void *ret;
|
||||
int prot = PROT_READ | PROT_WRITE;
|
||||
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
|
||||
|
||||
|
@ -137,12 +138,9 @@ static void * memory_hugepage_alloc(struct memtype *m, size_t len, size_t alignm
|
|||
flags |= MAP_LOCKED;
|
||||
#endif
|
||||
|
||||
void *ret = mmap(NULL, len, prot, flags, -1, 0);
|
||||
|
||||
if (ret == MAP_FAILED) {
|
||||
info("Failed to allocate huge pages: Check https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt (%s)", strerror(errno));
|
||||
ret = mmap(NULL, len, prot, flags, -1, 0);
|
||||
if (ret == MAP_FAILED)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue