allocate, allot

allocate, allot, assign和apportion是近义词。portion可以做动词。

<writingtips.cc> Allot implies more or less arbitrary or haphazard [任意的] selection and in itself conveys no suggestion of a fair or equal distribution.

Assign stresses authoritative and usually fixed allotment; it too carries no hint of an even division.

Apportion implies a principle of fair division, sometimes of equivalence in sharing, but more often of a proportionate distribution.

Allocate is used chiefly in reference to money, property, territory, or powers, and suggests definite appropriation to a particular person or group or dedication to a particular use. Appropriation is the process of saving money for a special purpose, or the money that is saved, especially by a business or government. </writingtips.cc>

例句: Lord Clarendon had, by this time, run as long a course as is usually allotted to the unscrupulous [无道德原则的] ministers of bad kings. --- 在狄更斯的"A Child's History of England"中,allot出现且仅出现了一次。

The malloc() function allocates size bytes and returns a pointer to the allocated memory. The memory is not initialized.

The calloc() function shall allocate unused space for an array of nelem elements each of whose size in bytes is elsize. The space shall be initialized to all bits 0.

The realloc() function shall deallocate the old object pointed to by ptr and return a pointer to a new object that has the size specified by size. If ptr is a null pointer, realloc() shall be equivalent to malloc() for the specified size. If ptr does not match a pointer returned earlier by calloc(), malloc(), or realloc() or if the space has previously been deallocated by a call to free() or realloc(), the behavior is undefined.

The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed.

The alloca() function allocates size bytes of space in the stack frame of the caller. This temporary space is automatically freed when the function that called alloca() returns to its caller. 这个函数基本上就是add sp, size.

六级/考研单词: allocate, allot, assign, implicit, arbitrary, convey, hint, equivalent, seldom, territory, tentative, array, stack

stackoverflow: On a standards-conforming C++ implementation,  the ordinary form of new will never return NULL; if allocation fails, a std::bad_alloc exception will be thrown. The new (nothrow) form does not throw exceptions, and will return NULL if allocation fails.

posted @ 2022-01-03 11:32  华容道专家  阅读(325)  评论(0)    收藏  举报