Created
May 9, 2011 02:02
-
-
Save bacek/961919 to your computer and use it in GitHub Desktop.
Alternative patch for gms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/gc/gc_gms.c b/src/gc/gc_gms.c | |
index 88b9956..48d2e28 100644 | |
--- a/src/gc/gc_gms.c | |
+++ b/src/gc/gc_gms.c | |
@@ -1511,6 +1511,8 @@ establish if *ptr is.owned | |
*/ | |
+#define INVALID_PTR_MASK (PTR_SIZE - 1) | |
+ | |
static int | |
gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) | |
{ | |
@@ -1521,7 +1523,7 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr)) | |
size_t i; | |
/* Not aligned pointers aren't pointers */ | |
- if (!obj || !item || ((int)obj & 3) || ((int)item & 3)) | |
+ if (!obj || !item || ((int)obj & INVALID_PTR_MASK) || ((int)item & INVALID_PTR_MASK)) | |
return 0; | |
if (!Parrot_gc_pool_is_maybe_owned(interp, self->pmc_allocator, item)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment