cvsuser     03/06/19 07:39:18

  Modified:    config/auto/memalign test_c.in test_c2.in
  Log:
  fix test for broken posix_memalign
  
  Revision  Changes    Path
  1.3       +1 -1      parrot/config/auto/memalign/test_c.in
  
  Index: test_c.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/auto/memalign/test_c.in,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- test_c.in 6 Jun 2003 08:29:30 -0000       1.2
  +++ test_c.in 19 Jun 2003 14:39:18 -0000      1.3
  @@ -9,6 +9,6 @@
   
   int main(int argc, char **argv) {
        void *ptr = memalign(256, 17);
  -     puts(((int)ptr & 0xff) == 0 ? "ok" : "nix");
  +     puts(ptr && ((int)ptr & 0xff) == 0 ? "ok" : "nix");
        return 0;
   }
  
  
  
  1.2       +9 -2      parrot/config/auto/memalign/test_c2.in
  
  Index: test_c2.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/auto/memalign/test_c2.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- test_c2.in        6 Jun 2003 08:29:30 -0000       1.1
  +++ test_c2.in        19 Jun 2003 14:39:18 -0000      1.2
  @@ -12,7 +12,14 @@
   {
        void * p;
        size_t s = 256;
  -     int i = posix_memalign(&p, s, s);
  -     puts(((int)p & 0xff) == 0 ? "ok" : "nix");
  +     /*
  +      * at least glibc 2.2.4's posix_memalign is broken
  +      * (it checks size for being a power of 2 instead of alignment)
  +      *
  +      * TODO only disable memalign_if_possible (which may have
  +      *      arbitrary allocation size)
  +      */
  +     int i = posix_memalign(&p, s, 177);
  +     puts(((int)p & 0xff) == 0 && i == 0 ? "ok" : "nix");
        return i;
   }
  
  
  

Reply via email to