mirror of
https://github.com/paboyle/Grid.git
synced 2025-08-18 12:11:53 +01:00
More verbose if alloc failure
This commit is contained in:
@@ -54,6 +54,9 @@ public:
|
|||||||
size_type bytes = __n*sizeof(_Tp);
|
size_type bytes = __n*sizeof(_Tp);
|
||||||
profilerAllocate(bytes);
|
profilerAllocate(bytes);
|
||||||
_Tp *ptr = (_Tp*) MemoryManager::CpuAllocate(bytes);
|
_Tp *ptr = (_Tp*) MemoryManager::CpuAllocate(bytes);
|
||||||
|
if ( (_Tp*)ptr == (_Tp *) NULL ) {
|
||||||
|
printf("Grid CPU Allocator got NULL for %lu bytes\n",(unsigned long) bytes );
|
||||||
|
}
|
||||||
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@@ -100,6 +103,9 @@ public:
|
|||||||
size_type bytes = __n*sizeof(_Tp);
|
size_type bytes = __n*sizeof(_Tp);
|
||||||
profilerAllocate(bytes);
|
profilerAllocate(bytes);
|
||||||
_Tp *ptr = (_Tp*) MemoryManager::SharedAllocate(bytes);
|
_Tp *ptr = (_Tp*) MemoryManager::SharedAllocate(bytes);
|
||||||
|
if ( (_Tp*)ptr == (_Tp *) NULL ) {
|
||||||
|
printf("Grid Shared Allocator got NULL for %lu bytes\n",(unsigned long) bytes );
|
||||||
|
}
|
||||||
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@@ -145,6 +151,9 @@ public:
|
|||||||
size_type bytes = __n*sizeof(_Tp);
|
size_type bytes = __n*sizeof(_Tp);
|
||||||
profilerAllocate(bytes);
|
profilerAllocate(bytes);
|
||||||
_Tp *ptr = (_Tp*) MemoryManager::AcceleratorAllocate(bytes);
|
_Tp *ptr = (_Tp*) MemoryManager::AcceleratorAllocate(bytes);
|
||||||
|
if ( (_Tp*)ptr == (_Tp *) NULL ) {
|
||||||
|
printf("Grid Device Allocator got NULL for %lu bytes\n",(unsigned long) bytes );
|
||||||
|
}
|
||||||
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
assert( ( (_Tp*)ptr != (_Tp *)NULL ) );
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user