Go: removing request registry.

Passing unsafe.Pointers (void *) from Go to C is complicated by an attempt
to make such pointers less unsafe.

A straightforward optimization is to replace 'unsafe.Pointer' with 'uintptr'
(thanks to Xin Huang for the idea: https://stackoverflow.com/a/44826533 ).

As a result, request registry with mutex is gone.
This commit is contained in:
Max Romanov
2017-12-06 12:16:02 +03:00
parent 0db4d25316
commit d14c0774c7
11 changed files with 96 additions and 244 deletions

View File

@@ -47,7 +47,8 @@ typedef struct {
nxt_port_msg_t wport_msg;
char wmmap_msg_buf[ sizeof(nxt_port_mmap_msg_t) * 8 ];
nxt_app_request_t r;
nxt_app_request_t request;
uintptr_t go_request;
nxt_go_msg_t *msg_last;
} nxt_go_run_ctx_t;