jdk/src/solaris/native/java/nio/MappedByteBuffer.c
changeset 895 67f1dc69ad10
parent 2 90ce3da70b43
child 1247 b4c26443dee5
equal deleted inserted replaced
894:15e617238139 895:67f1dc69ad10
    41     jint pageSize = sysconf(_SC_PAGESIZE);
    41     jint pageSize = sysconf(_SC_PAGESIZE);
    42     jint numPages = (len + pageSize - 1) / pageSize;
    42     jint numPages = (len + pageSize - 1) / pageSize;
    43     int result = 0;
    43     int result = 0;
    44     int i = 0;
    44     int i = 0;
    45     void *a = (void *) jlong_to_ptr(address);
    45     void *a = (void *) jlong_to_ptr(address);
    46     char * vec = (char *)malloc(numPages * sizeof(char));
    46 #ifdef __linux__
       
    47     unsigned char *vec = (unsigned char *)malloc(numPages * sizeof(char));
       
    48 #else
       
    49     char *vec = (char *)malloc(numPages * sizeof(char));
       
    50 #endif
    47 
    51 
    48     if (vec == NULL) {
    52     if (vec == NULL) {
    49         JNU_ThrowOutOfMemoryError(env, NULL);
    53         JNU_ThrowOutOfMemoryError(env, NULL);
    50         return JNI_FALSE;
    54         return JNI_FALSE;
    51     }
    55     }