opens = set(['(', '{', '['])
closes = set([')', '}', ']'])
-before = ''
+before = None
blank = False
for i in sys.stdin:
i = i.rstrip()
blank = True
else:
after = i.lstrip()
- if blank and len(before) and before[-1:] not in opens and after[:1] not in closes:
+ if blank and before is not None and before[-1:] not in opens and after[:1] not in closes:
sys.stdout.write('\n')
sys.stdout.write(i + '\n')
j = i.find('//')
#include <assert.h>
#include <stddef.h>
-#include <stdio.h>
+//#include <stdio.h>
#include <stdlib.h>
+#ifndef NDEBUG
#include <string.h>
+#endif
#include "core.h"
#include "process.h"
#include "rassert.h"
#ifdef INDIRECT_CORE
core_table_mem = malloc(table_size * sizeof(int));
rassert(core_table_mem);
+#ifndef NDEBUG
memset(core_table_mem, 0x55, table_size * sizeof(int));
+#endif
block_pool_init(&core_block_pool, n_blocks);
#endif
#include <assert.h>
#include <stddef.h>
-#include <stdio.h>
+//#include <stdio.h>
#include <stdlib.h>
+#ifndef NDEBUG
#include <string.h>
+#endif
#include "swap.h"
#include "process.h"
#include "rassert.h"
base = item->base;
blocks = item->limit - base;
- printf(
- "swap_move [%d,%d) to [%d,%d)\n",
- base,
- base + blocks,
- new_base,
- new_base + blocks
- );
+ //printf(
+ // "swap_move [%d,%d) to [%d,%d)\n",
+ // base,
+ // base + blocks,
+ // new_base,
+ // new_base + blocks
+ //);
assert(new_base <= base || new_base >= base + blocks);
#ifdef INDIRECT_SWAP
for (i = 0; i < blocks; ++i) {
limit = item->limit;
blocks = limit - item->base;
- printf(
- "swap_move_up [%d,%d) to [%d,%d)\n",
- limit - blocks,
- limit,
- new_limit - blocks,
- new_limit
- );
+ //printf(
+ // "swap_move_up [%d,%d) to [%d,%d)\n",
+ // limit - blocks,
+ // limit,
+ // new_limit - blocks,
+ // new_limit
+ //);
assert(new_limit >= limit || new_limit <= limit - blocks);
#ifdef INDIRECT_SWAP
blocks = -blocks;
#ifdef INDIRECT_SWAP
swap_table_mem = malloc(table_size * sizeof(int));
rassert(swap_table_mem);
+#ifndef NDEBUG
memset(swap_table_mem, 0x55, table_size * sizeof(int));
+#endif
block_pool_init(&swap_block_pool, n_blocks);
#endif