Missing std::nothrow on new

Forgot to add this when migrating to BOpenHashTable.
This commit is contained in:
Adrien Destugues
2015-01-12 09:46:40 +01:00
parent b8039c141e
commit c4718ea973
6 changed files with 11 additions and 11 deletions
@@ -753,13 +753,13 @@ uninit()
static status_t static status_t
init() init()
{ {
sTeamHash = new TeamTable(); sTeamHash = new(std::nothrow) TeamTable();
if (sTeamHash == NULL || sTeamHash->Init(64) != B_OK) if (sTeamHash == NULL || sTeamHash->Init(64) != B_OK)
return B_NO_MEMORY; return B_NO_MEMORY;
status_t status; status_t status;
sRulesHash = new RuleTable(); sRulesHash = new(std::nothrow) RuleTable();
if (sRulesHash == NULL || sRulesHash->Init(64) != B_OK) { if (sRulesHash == NULL || sRulesHash->Init(64) != B_OK) {
delete sTeamHash; delete sTeamHash;
return B_NO_MEMORY; return B_NO_MEMORY;
@@ -944,7 +944,7 @@ arp_init()
{ {
mutex_init(&sCacheLock, "arp cache"); mutex_init(&sCacheLock, "arp cache");
sCache = new AddressCache(); sCache = new(std::nothrow) AddressCache();
if (sCache == NULL || sCache->Init(64) != B_OK) { if (sCache == NULL || sCache->Init(64) != B_OK) {
mutex_destroy(&sCacheLock); mutex_destroy(&sCacheLock);
return B_NO_MEMORY; return B_NO_MEMORY;
@@ -407,7 +407,7 @@ ndp_init()
mutex_init(&sCacheLock, "ndp cache"); mutex_init(&sCacheLock, "ndp cache");
sCache = new AddressCache(); sCache = new(std::nothrow) AddressCache();
if (sCache == NULL || sCache->Init(64) != B_OK) { if (sCache == NULL || sCache->Init(64) != B_OK) {
mutex_destroy(&sCacheLock); mutex_destroy(&sCacheLock);
return B_NO_MEMORY; return B_NO_MEMORY;
+4 -4
View File
@@ -798,26 +798,26 @@ init_stack()
mutex_init(&sChainLock, "net chains"); mutex_init(&sChainLock, "net chains");
mutex_init(&sInitializeChainLock, "net intialize chains"); mutex_init(&sInitializeChainLock, "net intialize chains");
sFamilies = new FamilyTable(); sFamilies = new(std::nothrow) FamilyTable();
if (sFamilies == NULL || sFamilies->Init(10) != B_OK) { if (sFamilies == NULL || sFamilies->Init(10) != B_OK) {
status = B_NO_MEMORY; status = B_NO_MEMORY;
goto err5; goto err5;
} }
sProtocolChains = new ChainTable(); sProtocolChains = new(std::nothrow) ChainTable();
if (sProtocolChains == NULL || sProtocolChains->Init(10) != B_OK) { if (sProtocolChains == NULL || sProtocolChains->Init(10) != B_OK) {
status = B_NO_MEMORY; status = B_NO_MEMORY;
goto err6; goto err6;
} }
sDatalinkProtocolChains = new ChainTable(); sDatalinkProtocolChains = new(std::nothrow) ChainTable();
if (sDatalinkProtocolChains == NULL if (sDatalinkProtocolChains == NULL
|| sDatalinkProtocolChains->Init(10) != B_OK) { || sDatalinkProtocolChains->Init(10) != B_OK) {
status = B_NO_MEMORY; status = B_NO_MEMORY;
goto err7; goto err7;
} }
sReceivingProtocolChains = new ChainTable(); sReceivingProtocolChains = new(std::nothrow) ChainTable();
if (sReceivingProtocolChains == NULL if (sReceivingProtocolChains == NULL
|| sReceivingProtocolChains->Init(10) != B_OK) { || sReceivingProtocolChains->Init(10) != B_OK) {
status = B_NO_MEMORY; status = B_NO_MEMORY;
+2 -2
View File
@@ -887,7 +887,7 @@ devfs_mount(fs_volume* volume, const char* devfs, uint32 flags,
if (fs == NULL) { if (fs == NULL) {
err = B_NO_MEMORY; err = B_NO_MEMORY;
goto err; goto err;
} }
volume->private_volume = fs; volume->private_volume = fs;
volume->ops = &kVolumeOps; volume->ops = &kVolumeOps;
@@ -897,7 +897,7 @@ devfs_mount(fs_volume* volume, const char* devfs, uint32 flags,
recursive_lock_init(&fs->lock, "devfs lock"); recursive_lock_init(&fs->lock, "devfs lock");
fs->vnode_hash = new NodeTable(); fs->vnode_hash = new(std::nothrow) NodeTable();
if (fs->vnode_hash == NULL || fs->vnode_hash->Init(DEVFS_HASH_SIZE) != B_OK) { if (fs->vnode_hash == NULL || fs->vnode_hash->Init(DEVFS_HASH_SIZE) != B_OK) {
err = B_NO_MEMORY; err = B_NO_MEMORY;
goto err2; goto err2;
+1 -1
View File
@@ -2553,7 +2553,7 @@ elf_init(kernel_args *args)
image_init(); image_init();
sImagesHash = new ImageHash(); sImagesHash = new(std::nothrow) ImageHash();
if (sImagesHash == NULL) if (sImagesHash == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;
status_t init = sImagesHash->Init(IMAGE_HASH_SIZE); status_t init = sImagesHash->Init(IMAGE_HASH_SIZE);