On 21/03/2016 22:50, Emilio G. Cota wrote: > The problem with this approach is that the "point TCG to second buffer" > is not just a question of pointing code_gen_buffer to a new address; > we'd have to create a new tcg_ctx struct, since tcg_ctx has quite a few > elements that are dependent on code_gen_buffer (e.g. s->code_ptr, > s->code_buf).
Are these (or other fields similarly dependent on code_gen_buffer) ever read outside tb_lock? A quick "git grep -wl" suggests that they are only used from tcg/, which should only run while tb_lock is held. If not it would be enough to call tcg_prologue_init from tb_flush. Paolo