Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nwpierce committed Nov 12, 2024
1 parent 257c320 commit 83c996c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ In my limited experience, jsb's use of mmap is slow on Intel macOS. To reach hig
|-------|------------|---------|------------|----------------|----------------|
| macOS | Apple M1 | 3.2 | clang 16.0 | 936 mb/sec | 981 mb/sec |
| macOS | i7-1060NG7 | 1.2/3.8 | clang 16.0 | 654 mb/sec | 780 mb/sec |
| Linux | i7-1060NG7 | 1.2/3.8 | gcc 12.2.0 | 645 mb/sec | 848 mb/sec |
| Linux | i7-1060NG7 | 1.2/3.8 | gcc 12.2.0 | 650 mb/sec | 852 mb/sec |
| Linux | i7-1060NG7 | 1.2/3.8 | clang 16.0 | 667 mb/sec | 832 mb/sec |
| Linux | i3-2120 | 3.3 | gcc 12.2.0 | 423 mb/sec | 495 mb/sec |
| Linux | i3-2120 | 3.3 | clang-16.0 | 421 mb/sec | 427 mb/sec |
Expand Down
14 changes: 7 additions & 7 deletions jsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ enum { CB = __COUNTER__ };

#define YIELD(sz) do{ \
enum { ctr = __COUNTER__ - CB }; \
*((uint8_t *)&jsb->state) = ctr; \
jsb->state = ctr; \
ret = sz; \
goto yield; \
case ctr: break; \
Expand All @@ -459,7 +459,7 @@ enum { CB = __COUNTER__ };
if(dstpos != dstlen){ \
dst[dstpos++] = t; \
}else{ \
*(uint8_t *)&jsb->outb = t; \
jsb->outb = t; \
YIELD(JSB_OK); \
} \
}while(0)
Expand Down Expand Up @@ -508,10 +508,10 @@ PRIVATE size_t _jsb_update(jsb_t *jsb){
if(0){ /* save state and suspend */
yield:
debug(("yield: %d\n", ret));
*(size_t *)&jsb->avail_in -= srcpos;
*(size_t *)&jsb->avail_out -= dstpos;
*(uint8_t **)&jsb->next_in += srcpos;
*(uint8_t **)&jsb->next_out += dstpos;
jsb->avail_in -= srcpos;
jsb->avail_out -= dstpos;
jsb->next_in += srcpos;
jsb->next_out += dstpos;
jsb->total_in += srcpos;
jsb->total_out += dstpos;
return ret;
Expand All @@ -523,7 +523,7 @@ PRIVATE size_t _jsb_update(jsb_t *jsb){
dst[dstpos++] = jsb->outb;
else
return JSB_OK;
*(uint8_t *)&jsb->outb = JSB_INT_EOF;
jsb->outb = JSB_INT_EOF;
}

debug(("enter: %d\n", jsb->state));
Expand Down

0 comments on commit 83c996c

Please sign in to comment.