diff options
| author | David Jones | 2003-07-31 09:57:31 +0100 |
|---|---|---|
| committer | David Jones | 2003-07-31 09:57:31 +0100 |
| commit | 823a55b85cde5633b4e9d241fcd1cf513f0d88dd (patch) | |
| tree | 7cbe165a2371dda8ca11df414fd8107056786413 /mps/code | |
| parent | 87c57f6cdda30d7c5a80ee96c3f2a65fd6f7e89b (diff) | |
| download | emacs-823a55b85cde5633b4e9d241fcd1cf513f0d88dd.tar.gz emacs-823a55b85cde5633b4e9d241fcd1cf513f0d88dd.zip | |
Mps: properly fix mps_arena_has_addr for configura
Copied from Perforce
Change: 52060
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/commpost.nmk | 6 | ||||
| -rw-r--r-- | mps/code/global.c | 50 | ||||
| -rw-r--r-- | mps/code/walkt0.c | 8 |
3 files changed, 51 insertions, 13 deletions
diff --git a/mps/code/commpost.nmk b/mps/code/commpost.nmk index e3c05b740b8..bac9c888113 100644 --- a/mps/code/commpost.nmk +++ b/mps/code/commpost.nmk | |||
| @@ -33,7 +33,7 @@ mpmss.exe amcss.exe amcsshe.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awlu | |||
| 33 | mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \ | 33 | mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \ |
| 34 | finalcv.exe finaltest.exe arenacv.exe bttest.exe teletest.exe protcv.exe \ | 34 | finalcv.exe finaltest.exe arenacv.exe bttest.exe teletest.exe protcv.exe \ |
| 35 | abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \ | 35 | abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \ |
| 36 | locbwcss.exe locusss.exe \ | 36 | walkt0.exe locbwcss.exe locusss.exe \ |
| 37 | replay.exe replaysw.exe eventcnv.exe \ | 37 | replay.exe replaysw.exe eventcnv.exe \ |
| 38 | mmdw.lib mmsw.lib mps.lib mpsplan.lib: | 38 | mmdw.lib mmsw.lib mps.lib mpsplan.lib: |
| 39 | !IFDEF VARIETY | 39 | !IFDEF VARIETY |
| @@ -224,6 +224,10 @@ $(PFM)\$(VARIETY)\steptest.exe: $(PFM)\$(VARIETY)\steptest.obj \ | |||
| 224 | $(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \ | 224 | $(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \ |
| 225 | $(TESTLIBOBJ) | 225 | $(TESTLIBOBJ) |
| 226 | 226 | ||
| 227 | $(PFM)\$(VARIETY)\walkt0.exe: $(PFM)\$(VARIETY)\walkt0.obj \ | ||
| 228 | $(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(DWOBJ) $(DWTESTOBJ) \ | ||
| 229 | $(TESTLIBOBJ) | ||
| 230 | |||
| 227 | $(PFM)\$(VARIETY)\mmsw.lib: $(SWOBJ) | 231 | $(PFM)\$(VARIETY)\mmsw.lib: $(SWOBJ) |
| 228 | $(ECHO) $@ | 232 | $(ECHO) $@ |
| 229 | $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** | 233 | $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** |
diff --git a/mps/code/global.c b/mps/code/global.c index 051ba680480..0a209dee8b5 100644 --- a/mps/code/global.c +++ b/mps/code/global.c | |||
| @@ -37,8 +37,8 @@ static Bool arenaRingInit = FALSE; | |||
| 37 | static RingStruct arenaRing; /* <design/arena/#static.ring> */ | 37 | static RingStruct arenaRing; /* <design/arena/#static.ring> */ |
| 38 | 38 | ||
| 39 | /* forward declarations */ | 39 | /* forward declarations */ |
| 40 | void arenaEnterLock(Arena, void (*)(Lock)); | 40 | void arenaEnterLock(Arena, int); |
| 41 | void arenaLeaveLock(Arena, void (*)(Lock)); | 41 | void arenaLeaveLock(Arena, int); |
| 42 | 42 | ||
| 43 | /* ArenaControlPool -- get the control pool */ | 43 | /* ArenaControlPool -- get the control pool */ |
| 44 | 44 | ||
| @@ -424,21 +424,33 @@ void (ArenaEnter)(Arena arena) | |||
| 424 | #else | 424 | #else |
| 425 | void ArenaEnter(Arena arena) | 425 | void ArenaEnter(Arena arena) |
| 426 | { | 426 | { |
| 427 | arenaEnterLock(arena, LockClaim); | 427 | arenaEnterLock(arena, 0); |
| 428 | } | 428 | } |
| 429 | #endif | 429 | #endif |
| 430 | 430 | ||
| 431 | void arenaEnterLock(Arena arena, void (*lock)(Lock)) | 431 | void arenaEnterLock(Arena arena, int recursive) |
| 432 | { | 432 | { |
| 433 | Lock lock; | ||
| 434 | |||
| 433 | /* This check is safe to do outside the lock. Unless the client | 435 | /* This check is safe to do outside the lock. Unless the client |
| 434 | is also calling ArenaDestroy, but that's a protocol violation by | 436 | is also calling ArenaDestroy, but that's a protocol violation by |
| 435 | the client if so. */ | 437 | the client if so. */ |
| 436 | AVER(CHECKT(Arena, arena)); | 438 | AVER(CHECKT(Arena, arena)); |
| 437 | 439 | ||
| 438 | StackProbe(StackProbeDEPTH); | 440 | StackProbe(StackProbeDEPTH); |
| 439 | lock(ArenaGlobals(arena)->lock); | 441 | lock = ArenaGlobals(arena)->lock; |
| 442 | if(recursive) { | ||
| 443 | LockClaimRecursive(lock); | ||
| 444 | } else { | ||
| 445 | LockClaim(lock); | ||
| 446 | } | ||
| 440 | AVERT(Arena, arena); /* can't AVER it until we've got the lock */ | 447 | AVERT(Arena, arena); /* can't AVER it until we've got the lock */ |
| 441 | ShieldEnter(arena); | 448 | if(recursive) { |
| 449 | /* already in shield */ | ||
| 450 | } else { | ||
| 451 | ShieldEnter(arena); | ||
| 452 | } | ||
| 453 | return; | ||
| 442 | } | 454 | } |
| 443 | 455 | ||
| 444 | /* Same as ArenaEnter, but for the few functions that need to be | 456 | /* Same as ArenaEnter, but for the few functions that need to be |
| @@ -447,7 +459,7 @@ void arenaEnterLock(Arena arena, void (*lock)(Lock)) | |||
| 447 | 459 | ||
| 448 | void ArenaEnterRecursive(Arena arena) | 460 | void ArenaEnterRecursive(Arena arena) |
| 449 | { | 461 | { |
| 450 | arenaEnterLock(arena, LockClaimRecursive); | 462 | arenaEnterLock(arena, 1); |
| 451 | } | 463 | } |
| 452 | 464 | ||
| 453 | /* ArenaLeave -- leave the state where you can look at MPM data structures */ | 465 | /* ArenaLeave -- leave the state where you can look at MPM data structures */ |
| @@ -461,21 +473,35 @@ void (ArenaLeave)(Arena arena) | |||
| 461 | #else | 473 | #else |
| 462 | void ArenaLeave(Arena arena) | 474 | void ArenaLeave(Arena arena) |
| 463 | { | 475 | { |
| 464 | arenaLeaveLock(arena, LockReleaseMPM); | 476 | arenaLeaveLock(arena, 0); |
| 465 | } | 477 | } |
| 466 | #endif | 478 | #endif |
| 467 | 479 | ||
| 468 | void arenaLeaveLock(Arena arena, void (*unlock)(Lock)) | 480 | void arenaLeaveLock(Arena arena, int recursive) |
| 469 | { | 481 | { |
| 482 | Lock lock; | ||
| 483 | |||
| 470 | AVERT(Arena, arena); | 484 | AVERT(Arena, arena); |
| 471 | ShieldLeave(arena); | 485 | |
| 486 | lock = ArenaGlobals(arena)->lock; | ||
| 487 | |||
| 488 | if(recursive) { | ||
| 489 | /* no need to leave shield */ | ||
| 490 | } else { | ||
| 491 | ShieldLeave(arena); | ||
| 492 | } | ||
| 472 | ProtSync(arena); /* <design/prot/#if.sync> */ | 493 | ProtSync(arena); /* <design/prot/#if.sync> */ |
| 473 | unlock(ArenaGlobals(arena)->lock); | 494 | if(recursive) { |
| 495 | LockReleaseRecursive(lock); | ||
| 496 | } else { | ||
| 497 | LockReleaseMPM(lock); | ||
| 498 | } | ||
| 499 | return; | ||
| 474 | } | 500 | } |
| 475 | 501 | ||
| 476 | void ArenaLeaveRecursive(Arena arena) | 502 | void ArenaLeaveRecursive(Arena arena) |
| 477 | { | 503 | { |
| 478 | arenaLeaveLock(arena, LockReleaseRecursive); | 504 | arenaLeaveLock(arena, 1); |
| 479 | } | 505 | } |
| 480 | 506 | ||
| 481 | /* mps_exception_info -- pointer to exception info | 507 | /* mps_exception_info -- pointer to exception info |
diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c index 5009c1590f5..f11379dec77 100644 --- a/mps/code/walkt0.c +++ b/mps/code/walkt0.c | |||
| @@ -81,6 +81,11 @@ static void stepper(mps_addr_t object, mps_fmt_t format, | |||
| 81 | { | 81 | { |
| 82 | mps_arena_t arena = p; | 82 | mps_arena_t arena = p; |
| 83 | 83 | ||
| 84 | UNUSED(format); | ||
| 85 | UNUSED(pool); | ||
| 86 | UNUSED(pool); | ||
| 87 | UNUSED(s); | ||
| 88 | |||
| 84 | if(!mps_arena_has_addr(arena, object)) { | 89 | if(!mps_arena_has_addr(arena, object)) { |
| 85 | printf("Stepper got called with object at address %p,\n" | 90 | printf("Stepper got called with object at address %p,\n" |
| 86 | "which is not managed by the arena!\n", (void *)object); | 91 | "which is not managed by the arena!\n", (void *)object); |
| @@ -155,6 +160,9 @@ int main(int argc, char **argv) | |||
| 155 | mps_thr_t thread; | 160 | mps_thr_t thread; |
| 156 | void *r; | 161 | void *r; |
| 157 | 162 | ||
| 163 | UNUSED(argc); | ||
| 164 | UNUSED(argv); | ||
| 165 | |||
| 158 | die(mps_arena_create(&arena, mps_arena_class_vm(), | 166 | die(mps_arena_create(&arena, mps_arena_class_vm(), |
| 159 | testArenaSIZE), | 167 | testArenaSIZE), |
| 160 | "arena_create"); | 168 | "arena_create"); |