-static void su_local_setup(pTHX) {
-#define su_local_setup() su_local_setup(aTHX)
- MY_CXT_INIT;
-
- MY_CXT.stack_placeholder = NULL;
-
- /* NewOp() calls calloc() which just zeroes the memory with memset(). */
- Zero(&(MY_CXT.unwind_storage.return_op), 1, LISTOP);
- MY_CXT.unwind_storage.return_op.op_type = OP_RETURN;
- MY_CXT.unwind_storage.return_op.op_ppaddr = PL_ppaddr[OP_RETURN];
-
- Zero(&(MY_CXT.unwind_storage.proxy_op), 1, OP);
- MY_CXT.unwind_storage.proxy_op.op_type = OP_STUB;
- MY_CXT.unwind_storage.proxy_op.op_ppaddr = NULL;
-
- Zero(&(MY_CXT.yield_storage.leave_op), 1, UNOP);
- MY_CXT.yield_storage.leave_op.op_type = OP_STUB;
- MY_CXT.yield_storage.leave_op.op_ppaddr = NULL;
-
- Zero(&(MY_CXT.yield_storage.proxy_op), 1, OP);
- MY_CXT.yield_storage.proxy_op.op_type = OP_STUB;
- MY_CXT.yield_storage.proxy_op.op_ppaddr = NULL;
-
- MY_CXT.uplevel_storage.top = NULL;
- MY_CXT.uplevel_storage.root = NULL;
- MY_CXT.uplevel_storage.count = 0;
-
- MY_CXT.uid_storage.map = NULL;
- MY_CXT.uid_storage.used = 0;
- MY_CXT.uid_storage.alloc = 0;
+static void xsh_user_global_teardown(pTHX) {
+ XSH_LOCK(&su_uid_seq_counter_mutex);
+ PerlMemShared_free(su_uid_seq_counter.seqs);
+ su_uid_seq_counter.size = 0;
+ XSH_UNLOCK(&su_uid_seq_counter_mutex);