Changeset 6921 in vbox for trunk/include/VBox/com
- Timestamp:
- Feb 12, 2008 1:18:35 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28073
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/array.h
r6898 r6921 494 494 #if defined (VBOX_WITH_XPCOM) 495 495 496 AssertReturn (aNewSize > 0, false); 497 498 m.arr = (T *) nsMemory::Alloc (aNewSize * sizeof (T)); 496 /* Note: for zero-sized arrays, we use the size of 1 because whether 497 * malloc(0) returns a null pointer or not (which is used in isNull()) 498 * is implementation-dependent according to the C standard. */ 499 500 m.arr = (T *) nsMemory::Alloc (RT_MAX (aNewSize, 1) * sizeof (T)); 499 501 AssertReturn (m.arr != NULL, false); 500 502 … … 505 507 506 508 #else 507 508 AssertReturn (aNewSize > 0, false);509 509 510 510 SAFEARRAYBOUND bound = { aNewSize, 0 }; … … 987 987 #if defined (VBOX_WITH_XPCOM) 988 988 989 AssertReturn (aNewSize > 0, false); 990 991 Base::m.arr = (I **) nsMemory::Alloc (aNewSize * sizeof (I *)); 989 /* Note: for zero-sized arrays, we use the size of 1 because whether 990 * malloc(0) returns a null pointer or not (which is used in isNull()) 991 * is implementation-dependent according to the C standard. */ 992 993 Base::m.arr = (I **) nsMemory::Alloc (RT_MAX (aNewSize, 1) * sizeof (I *)); 992 994 AssertReturn (Base::m.arr != NULL, false); 993 995 … … 998 1000 999 1001 #else 1000 1001 AssertReturn (aNewSize > 0, false);1002 1002 1003 1003 SAFEARRAYBOUND bound = { aNewSize, 0 };
Note:
See TracChangeset
for help on using the changeset viewer.