The R Project SVN R

Rev

Rev 11781 | Rev 13587 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11781 Rev 12256
Line 1021... Line 1021...
1021
	}
1021
	}
1022
    }
1022
    }
1023
    return NULL;
1023
    return NULL;
1024
}
1024
}
1025
 
1025
 
-
 
1026
extern int R_Is_Running;
-
 
1027
void Rf_warning(const char *, ...);
-
 
1028
 
1026
/* BDR 2000-10-28: add loop count as this infinitely looped */
1029
/* BDR 2000-10-28: add loop count as this infinitely looped */
1027
void *wsbrk (long size)
1030
void *wsbrk (long size)
1028
{
1031
{
1029
    void *tmp;
1032
    void *tmp;
1030
    int count = 0;
1033
    int count = 0;
1031
    if (PageSize == 0) PageSize = getpagesize();
1034
    if (PageSize == 0) PageSize = getpagesize();
1032
 
1035
 
1033
    if (size > 0) {
1036
    if (size > 0) {
1034
	/* will this take us over the limit? */
1037
	/* will this take us over the limit? */
1035
	if (totalAllocated + size > R_max_memory) 
1038
	if (totalAllocated + size > R_max_memory) {
-
 
1039
	    if(R_Is_Running) 
-
 
1040
		Rf_warning("Reached total allocation of %dMb: see help(memory.size)", R_max_memory/1048576);
1036
	    return (void*)-1;
1041
	    return (void*)-1;
-
 
1042
	}
1037
 
1043
 
1038
	/* first check if request fits in reserved space, and if not
1044
	/* first check if request fits in reserved space, and if not
1039
	   try to reserve the address space (never unreserved) */
1045
	   try to reserve the address space (never unreserved) */
1040
	if (gAddressBase == 0) {
1046
	if (gAddressBase == 0) {
1041
	    gReservedSize = max (RESERVED_SIZE, AlignPage64K(size));
1047
	    gReservedSize = max (RESERVED_SIZE, AlignPage64K(size));