Remove overly fancy profile sync code.

This commit is contained in:
C. Guy Yarvin 2014-11-30 16:59:22 -08:00
parent 53eae798e2
commit f56aa55a32
3 changed files with 2 additions and 230 deletions

View File

@ -325,11 +325,6 @@
u3_noun
u3a_take(u3_noun som);
/* u3a_toke(): like u3a_take(), but without touching junior memory.
*/
u3_noun
u3a_toke(u3_noun som);
/* u3a_left(): true of junior if preserved.
*/
c3_o

222
n/a.c
View File

@ -765,158 +765,6 @@ _me_gain_use(u3_noun dog)
}
}
/* _me_coke_north_in(): coke subjuniors on a north road.
*/
static u3_noun _me_coke_north(u3_noun);
static u3_noun
_me_coke_north_in(u3_noun som)
{
c3_assert(u3_none != som);
if ( _(u3a_is_cat(som)) ) {
return som;
}
else {
u3_noun dog = som;
if ( _(u3a_north_is_senior(u3R, dog)) ) {
return dog;
}
else if ( _(u3a_north_is_junior(u3R, dog)) ) {
return _me_coke_north(dog);
}
else {
_me_gain_use(dog);
return dog;
}
}
}
/* _me_coke_north(): coke juniors on a north road.
*/
static u3_noun
_me_coke_north(u3_noun dog)
{
c3_assert(c3y == u3a_north_is_junior(u3R, dog));
if ( !_(u3a_north_is_junior(u3R, dog)) ) {
if ( !_(u3a_north_is_senior(u3R, dog)) ) {
_me_gain_use(dog);
}
return dog;
}
else {
if ( c3y == u3a_is_pom(dog) ) {
u3a_cell* old_u = u3a_to_ptr(dog);
c3_w* new_w = u3a_walloc(c3_wiseof(u3a_cell));
u3_noun new = u3a_de_twin(dog, new_w);
u3a_cell* new_u = (u3a_cell*)(void *)new_w;
new_u->mug_w = old_u->mug_w;
new_u->hed = _me_coke_north_in(old_u->hed);
new_u->tel = _me_coke_north_in(old_u->tel);
/* Don't borrow mug slot to record new destination.
*/
return new;
}
else {
u3a_atom* old_u = u3a_to_ptr(dog);
c3_w* new_w = u3a_walloc(old_u->len_w + c3_wiseof(u3a_atom));
u3_noun new = u3a_de_twin(dog, new_w);
u3a_atom* new_u = (u3a_atom*)(void *)new_w;
new_u->mug_w = old_u->mug_w;
new_u->len_w = old_u->len_w;
{
c3_w i_w;
for ( i_w=0; i_w < old_u->len_w; i_w++ ) {
new_u->buf_w[i_w] = old_u->buf_w[i_w];
}
}
/* Don't borrow mug slot to record new destination.
*/
return new;
}
}
}
/* _me_coke_south_in(): coke subjuniors on a south road.
*/
static u3_noun _me_coke_south(u3_noun);
static u3_noun
_me_coke_south_in(u3_noun som)
{
c3_assert(u3_none != som);
if ( _(u3a_is_cat(som)) ) {
return som;
}
else {
u3_noun dog = som;
if ( _(u3a_south_is_senior(u3R, dog)) ) {
return dog;
}
else if ( _(u3a_south_is_junior(u3R, dog)) ) {
return _me_coke_south(dog);
}
else {
_me_gain_use(dog);
return dog;
}
}
}
/* _me_coke_south(): coke juniors on a south road.
*/
static u3_noun
_me_coke_south(u3_noun dog)
{
c3_assert(c3y == u3a_south_is_junior(u3R, dog));
if ( !_(u3a_south_is_junior(u3R, dog)) ) {
if ( !_(u3a_south_is_senior(u3R, dog)) ) {
_me_gain_use(dog);
}
return dog;
}
else {
if ( c3y == u3a_is_pom(dog) ) {
u3a_cell* old_u = u3a_to_ptr(dog);
c3_w* new_w = u3a_walloc(c3_wiseof(u3a_cell));
u3_noun new = u3a_de_twin(dog, new_w);
u3a_cell* new_u = (u3a_cell*)(void *)new_w;
new_u->mug_w = old_u->mug_w;
new_u->hed = _me_coke_south_in(old_u->hed);
new_u->tel = _me_coke_south_in(old_u->tel);
/* Don't borrow mug slot to record new destination.
*/
return new;
}
else {
u3a_atom* old_u = u3a_to_ptr(dog);
c3_w* new_w = u3a_walloc(old_u->len_w + c3_wiseof(u3a_atom));
u3_noun new = u3a_de_twin(dog, new_w);
u3a_atom* new_u = (u3a_atom*)(void *)new_w;
new_u->mug_w = old_u->mug_w;
new_u->len_w = old_u->len_w;
{
c3_w i_w;
for ( i_w=0; i_w < old_u->len_w; i_w++ ) {
new_u->buf_w[i_w] = old_u->buf_w[i_w];
}
}
/* Don't borrow mug slot to record new destination.
*/
return new;
}
}
}
/* _me_copy_north_in(): copy subjuniors on a north road.
*/
static u3_noun _me_copy_north(u3_noun);
@ -1113,58 +961,6 @@ _me_copy_south(u3_noun dog)
}
}
/* _me_toke_north(): toke on a north road.
*/
static u3_noun
_me_toke_north(u3_noun dog)
{
if ( c3y == u3a_north_is_senior(u3R, dog) ) {
/* senior pointers are not refcounted
*/
return dog;
}
else if ( c3y == u3a_north_is_junior(u3R, dog) ) {
/* junior pointers are copied
*/
u3_noun mos = _me_copy_north(dog);
// printf("north: %p to %p\r\n", u3a_to_ptr(dog), u3a_to_ptr(mos));
return mos;
}
else {
/* normal pointers are refcounted
*/
_me_gain_use(dog);
return dog;
}
}
/* _me_toke_south(): toke on a south road.
*/
static u3_noun
_me_toke_south(u3_noun dog)
{
if ( c3y == u3a_south_is_senior(u3R, dog) ) {
/* senior pointers are not refcounted
*/
return dog;
}
else if ( c3y == u3a_south_is_junior(u3R, dog) ) {
/* junior pointers are copied
*/
u3_noun mos = _me_copy_south(dog);
// printf("south: %p to %p\r\n", u3a_to_ptr(dog), u3a_to_ptr(mos));
return mos;
}
else {
/* normal pointers are refcounted
*/
_me_gain_use(dog);
return dog;
}
}
/* _me_take_north(): take on a north road.
*/
static u3_noun
@ -1234,24 +1030,6 @@ u3a_take(u3_noun som)
}
}
/* u3a_toke(): like u3a_take(), but without touching junior memory.
*/
u3_noun
u3a_toke(u3_noun som)
{
c3_assert(u3_none != som);
if ( _(u3a_is_cat(som)) ) {
return som;
}
else {
return _(u3a_is_north(u3R))
? _me_toke_north(som)
: _me_toke_south(som);
}
}
/* u3a_left(): true of junior if preserved.
*/
c3_o

5
n/t.c
View File

@ -124,9 +124,8 @@ _t_samp_process(u3_road* rod_u)
u3_noun laj = _t_jet_label(rod_u, bat);
if ( u3_none == laj ) { abort(); }
// lab = u3a_take(laj); u3a_wash(laj);
lab = u3a_toke(laj);
lab = u3a_take(laj);
u3a_wash(laj);
}
// Add the label to the traced label stack, trimming recursion.
//