places: improve comments on msg_chain treatment
This commit is contained in:
parent
6d4c25a322
commit
68421f05dd
|
@ -1592,7 +1592,8 @@ place_async_channel_val {
|
||||||
gcMARK2(pac->msg_chains, gc);
|
gcMARK2(pac->msg_chains, gc);
|
||||||
gcMARK2(pac->wakeup_signal, gc);
|
gcMARK2(pac->wakeup_signal, gc);
|
||||||
|
|
||||||
/* mark master-allocated objects within each messages: */
|
/* mark master-allocated objects within each messages; the
|
||||||
|
raw pairs that form the list are embedded in each message block */
|
||||||
j = pac->out;
|
j = pac->out;
|
||||||
sz = pac->size;
|
sz = pac->size;
|
||||||
for (i = pac->count; i--; ) {
|
for (i = pac->count; i--; ) {
|
||||||
|
|
|
@ -3012,11 +3012,12 @@ Scheme_Place_Async_Channel *place_async_channel_create() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ch = GC_master_malloc_tagged(sizeof(Scheme_Place_Async_Channel));
|
ch = GC_master_malloc_tagged(sizeof(Scheme_Place_Async_Channel));
|
||||||
|
ch->so.type = scheme_place_async_channel_type;
|
||||||
|
|
||||||
msgs = GC_master_malloc(sizeof(Scheme_Object*) * 8);
|
msgs = GC_master_malloc(sizeof(Scheme_Object*) * 8);
|
||||||
msg_memory = GC_master_malloc(sizeof(void*) * 8);
|
msg_memory = GC_master_malloc(sizeof(void*) * 8);
|
||||||
msg_chains = GC_master_malloc(sizeof(Scheme_Object*) * 8);
|
msg_chains = GC_master_malloc(sizeof(Scheme_Object*) * 8);
|
||||||
|
|
||||||
ch->so.type = scheme_place_async_channel_type;
|
|
||||||
ch->in = 0;
|
ch->in = 0;
|
||||||
ch->out = 0;
|
ch->out = 0;
|
||||||
ch->count = 0;
|
ch->count = 0;
|
||||||
|
@ -3186,6 +3187,8 @@ static void place_async_send(Scheme_Place_Async_Channel *ch, Scheme_Object *uo)
|
||||||
int cnt;
|
int cnt;
|
||||||
|
|
||||||
o = places_serialize(uo, &msg_memory, &master_chain, &invalid_object);
|
o = places_serialize(uo, &msg_memory, &master_chain, &invalid_object);
|
||||||
|
/* uo needs to stay live until `master_chain` is registered in `ch` */
|
||||||
|
|
||||||
if (!o) {
|
if (!o) {
|
||||||
if (invalid_object) {
|
if (invalid_object) {
|
||||||
scheme_contract_error("place-channel-put",
|
scheme_contract_error("place-channel-put",
|
||||||
|
@ -3245,6 +3248,9 @@ static void place_async_send(Scheme_Place_Async_Channel *ch, Scheme_Object *uo)
|
||||||
maybe_report_message_size(ch);
|
maybe_report_message_size(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure `uo` is treated as live until here: */
|
||||||
|
if (!uo) scheme_signal_error("?");
|
||||||
|
|
||||||
{
|
{
|
||||||
intptr_t msg_size;
|
intptr_t msg_size;
|
||||||
msg_size = GC_message_allocator_size(msg_memory);
|
msg_size = GC_message_allocator_size(msg_memory);
|
||||||
|
|
|
@ -4114,7 +4114,7 @@ typedef struct Scheme_Place_Async_Channel {
|
||||||
#endif
|
#endif
|
||||||
Scheme_Object **msgs;
|
Scheme_Object **msgs;
|
||||||
void **msg_memory;
|
void **msg_memory;
|
||||||
Scheme_Object **msg_chains;
|
Scheme_Object **msg_chains; /* lists embedded in message blocks; specially traversed during GC */
|
||||||
intptr_t mem_size;
|
intptr_t mem_size;
|
||||||
intptr_t reported_size; /* size reported to master GC; avoid reporting too often */
|
intptr_t reported_size; /* size reported to master GC; avoid reporting too often */
|
||||||
void *wakeup_signal;
|
void *wakeup_signal;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user